Python: Navigate to portable devices directory (Windows 7)

匆匆过客 提交于 2020-01-14 10:23:09

问题


I'm trying to solve a question I have created about how to read the recorded date of the videos I took with a windows phone. It seems that the creation date are overwritten when the files are "sync" to my computer.

I'm trying to get around this by looking at the files in the phone directly. So I need to access to

"Computer\Windows Phone\Phone\Pictures\Camera Roll" 

My problem is that I can only get os.chdir() to work on paths that has C:// as root

Any suggestions?

Update

I tried to place and run a file that prints the current directory. Which gave me the result

C:\Users\<myUser~1.COM>\AppData\Local\Temp\WPDNSE\{<a lot of numbers and dashes>}

回答1:


I am not familiar with Windows Phone paths in particular, but you should be able to figure out the "real" path by using the Windows file explorer to look at the properties of a file or folder. Right-click, choose Properties and look for a Location field.

Note that some "folders", such as the ones under "Libraries", are actually XML files pointing to multiple other locations.




回答2:


Maybe the phone is connect via MTP.

How to access an MTP USB device with python

could help then.

[EDIT] They mentioned calibre there. The source code of calibre mabye already contain functions for getting file informations on mobile devices.



来源:https://stackoverflow.com/questions/21457933/python-navigate-to-portable-devices-directory-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!