in my software I'm checking for USB Memory or SD Card by opening /dev/sda1 or /dev/mmcblk0p1. If one of these files exists I'm mounting by
Now I can read/write the media/usb or /media/sd directory. If the user wants to remove the devices he will tell my software an I'm unmounting by
Now the USB or SD Card can be removed. When I'm trying to re-enter the USB or SD Card they are mapped to another device (/dev/sda2 and /dev/mmcblk1p1) later (/dev/sda3 and /dev/mmcblk2p1). So it's hard for me to find out if an USB Memory or SD Card was plugged in. How is it possible to use /dev/sda1 and /dev/mmcblk0p1 every time?
Tanks and kind regards