in Education by
I use libudev to monitor storage devices (usb keys, etc) so that when they are modified I get a notification in my program. Libudev tells you whether or not a device has been added,removed,etc and gives you the device node. For example, if I add an SD card in my system, libudev will tell me that "/dev/mmcblk0p1" was added. When this happens, I want to get the mount point of the device as well. So I check /proc/mounts to see what mount path the device has been mapped to. While this seems to work okay, I'm not sure whether libudev sends me the signal that a device has been added before it mounts the device, after it mounts the device or somewhere in between (which would mean that me checking the /proc/mounts file right after I get the signal is an unreliable method). So my question is does anyone know when libudev sends the signal, and whether or not the method I use to get the device's mount path is reliable? If it isn't, is there another way to get the mount path given the device node that is reliable? Regards, Pris JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I can't give a guarantee, but I'm doing something very similar and it seems to work for me too. I listen for block/disk add events, find corresponding block/partition devices and then parse /proc/mounts looking for the dev node.

Related questions

0 votes
    The _____________ command is used on Linux for getting the DNS and host-related information. (a) dnslookup (b) ... Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
    First, yes I know about this question, but I'm looking for a bit more information that that. I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    The disk platters mounted on a spindle and the heads mounted on a disk arm are together known as ... , Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    ______ splits a data frame and results an array (hence the da). Hopefully you're getting the idea here. ... Regression of R Programming Select the correct answer from above options...
asked Feb 11, 2022 in Education by JackTerrance
0 votes
    Optical disk _______ systems contain a few drives and numerous disks that can be loaded into one of the ... , Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    _________ involves predicting a response with meaningful magnitude, such as quantity sold, stock price, or return on ... R Programming Select the correct answer from above options...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    Is the following code supposed to compile? #include void foo() { const std::pair x = {1, 2}; ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    Is the following code supposed to compile? #include void foo() { const std::pair x = {1, 2}; ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I'd like to ensure my RAII class is always allocated on the stack. How do I prevent a class from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I'd like to ensure my RAII class is always allocated on the stack. How do I prevent a class from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 7, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 6, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
...