[Pythonmac-SIG] converting file paths between HFS and POSIXformats

Schollnick, Benjamin Benjamin.Schollnick at xerox.com
Mon Apr 25 16:13:38 CEST 2005


> The former; e.g. 'Mac HD:Users:has:' to '/Users/has' and back.


The issue is that it has to be partially hard coded....  I have not
figured out a way to do this completely platform independent...

>>> import os
>>> mac_path = "Mac HD:Users:has:"
>>> PC_path = str(os.sep).join (mac_path.split (":"))
>>> print PC_path
Mac HD\Users\has\


		- Benjamin


More information about the Pythonmac-SIG mailing list