mmkw43
Posts: 554
Joined: Tue Dec 24, 2013 6:18 pm

USB ID number

Sun Apr 10, 2016 4:03 pm

I'm using a subprocess call to list the folders in /media/pi then converting it to a string to get the USB ID number (or whatever you call that number).

My question is, when you install a USB drive (just once at your first setup and never again) (detected by raspian, not manually installed), is the USB ID always the first folder that is listed?

When I --

ls /media/pi

I get 2 folders --

ID number SETTINGS

and I'm hoping that the ID # will always precede the SETTINGS folder. Trying to make it easy for a user so they just plug in the drive and they don't have to name a folder themselves -- the script will do it. Come to think about it, guess I could subtract SETTINGS from the string but heck, I'll ask the question anyway.

lol

mmkw43
Posts: 554
Joined: Tue Dec 24, 2013 6:18 pm

Re: USB ID number

Sun Apr 10, 2016 4:28 pm

It may be better to just get rid of SETTINGS in the string? Asl ong as nothing is added to the /media/pi folder, the USB ID number and settings should always be the only 2 folders right?

Return to “General discussion”