Article 5BNFW How to know the existence of pendrive or memory card in embedded Linux?

How to know the existence of pendrive or memory card in embedded Linux?

by
Nishanth1829
from LinuxQuestions.org on (#5BNFW)
Hi all,
I am using an Embedded SOM and application is running on GTK+. In my app, I need to show pendrive and memory card icons based on their existence. That is if sd card is inserted, the logo should be shown in my app and vice versa if removed in between.I have did this by using statfs() for every 5 seconds in C as I found that the pendrive is always mounted as /media/sda1 and memory card is always mounted as /media/mmcblk1p1. But this logic does not work perfectly some times and shows the icons wrongly. Is my way correct ? If not kindly guide me how to detect pendrive and memory card existence programmatically in polling method.

Thanks and regards,
Nishanth Kumarlatest?d=yIl2AUoC8zA latest?i=SUlEI4Cg3-Y:h8d-627wSpU:F7zBnMy latest?i=SUlEI4Cg3-Y:h8d-627wSpU:V_sGLiP latest?d=qj6IDK7rITs latest?i=SUlEI4Cg3-Y:h8d-627wSpU:gIN9vFwSUlEI4Cg3-Y
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments