On Tue, Jun 6, 2017 at 7:36 PM, Fred Fishbin <fredfish...@hotmail.com> wrote: > > I want to write little program that my friend can run - he'll plug a USB drive > into his Windows 7 PC, plug his phone in a USB port on same PC, then run my > program and it'll xfer some audiobook files over for him. > > I plugged the USB drive in and it became "G:\", but the phone plugged in and > became just "SAMSUNG-SM-G930V", no drive designation, just a Portable Media > Device. Windows Explore can go there so the files are accessible, the phone > isn't looking him out, but what do I use for a path? I tried several > different > listdir()'s nothing worked.
The shell is probably mounting the device via the Windows Portable Devices (WPD) API. It isn't mounted as a USB disk with a file system, so it won't be assigned a drive letter that you can simply use via file-system APIs such as open (CreateFile), listdir (FindFirstFile), etc. You can look into using WPD Automation via win32com [1]. I haven't used WPD, so I can't offer specific help. https://msdn.microsoft.com/library/dd389295 -- https://mail.python.org/mailman/listinfo/python-list