I have 2 PC's(a Linux and a Windows) connected to a local network which is on a different floor. People on that floor connect their USB Pen-drives to either one of the PC and I am suppose to copy different specific set of files to different people.
Previously,
- what i did was so hard (get to the floor and do it manually)
- Later i wrote a python program that copies specific set of file to
specific person on my decision through
ssh
. (ie,. I log in to the specific machine throughssh
, ask users (over a phone call) one by one to insert their pen-drive and then i execute the python program which accepted an argument. This argument is nothing but a name whom i wanted to copy, and by receiving the argument the program decides which files to be copied to the pen-drive).
Still the process is bit tedious,.. Because only one pen-drive could connected and i had to do this repeatedly for every user.
So to reduce the total time consumed, i connected USB hubs on both the systems to make multiple insert of pen-drive's in a given time. And here comes the problem, decide which device belonged to whom.
Question : Is it possible to find the mount point of a pen-drive from the SerialNumber
using python ? (it would be great if its python, since the main program is written in python)
The reason i am considering SerialNumber
over,
UUID
- It changes when the device is formattedVendor
,ProdID
andManufacturer
- Not sure that if they will be different. (ie,. what if its from the same manufacturer and a same model)
I tried wmi
for windows.. and got this code from SO,(Sorry i don't have the link. Took it long back)
import win32com.client
wmi = win32com.client.GetObject ("winmgmts:")
for usb in wmi.InstancesOf ("Win32_USBHub"):
print usb.DeviceID
the output i get is
USB\VID_5986&PID_0292\6&4817B6D&0&6
USB\VID_8087&PID_0024\5&55D1EEC&0&1
USB\VID_8087&PID_0024\5&88B8ABA&0&1
USB\ROOT_HUB20\4&11F77F7&0
USB\ROOT_HUB20\4&62BF53D&0
USB\VID_03F0&PID_3307\JN0W5LAB0ZHQ5VK8
its the similar case in linux, all i able to get is serialnumber, using usb-devices
. But unable to get its corresponding mount-point
Any Ideas please...