here is my situation, I am writing a c program in linux and in the program I am mounting 2 usb devices attached to 2 specific ports in the computer. (eg : I have to mount the usb attached to the left port in to /mnt/left and the right port to /mnt/right) and the attachment order of those devices may differ (eg: left port usb may or may not be attached before the right.) In this case what should i do?
Again we meet.
Here you have your USB ports. Check which is for left and which is for right -> /sys/bus/usb/devices. When you attach device to usb port, you will get a dmesg message about to which port it is attached. Something like this:
input: Logitech USB Receiver as /devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/input/input
You just need to pair your usb device with the port.