On Fri, Apr 22, 2005 at 05:08:47PM +0100, has wrote:
> I'm kinda leery of using MacPython's CF wrapper as it's a bit buggy in 
> places. Still your example looks like it works ok - good suggestion, thanks.
> 
> One bit I'm not sure about though - if I run this:
> 
> u = toCF('A Non-mounted 
> Drive:').CFURLCreateWithFileSystemPath(kCFURLHFSPathStyle, False)
> 
> print u.CFURLCopyFileSystemPath(kCFURLPOSIXPathStyle).toPython()
> 
> I get '/A Non-mounted Drive' whereas I was assuming it should be
> '/Volumes/A Non-mounted Drive' - is that correct?

>>> u = toCF('Data:').CFURLCreateWithFileSystemPath(kCFURLHFSPathStyle, False)
>>> u.CFURLCopyFileSystemPath(kCFURLPOSIXPathStyle).toPython()
u'/Volumes/Data'
>>> u = toCF('Foo:').CFURLCreateWithFileSystemPath(kCFURLHFSPathStyle, False)
>>> u.CFURLCopyFileSystemPath(kCFURLPOSIXPathStyle).toPython()
u'/Foo'

Yeah, I see what you mean.  You can't expect this kind of conversion
to work on a nonexistent file, and it's not one-to-one in any
case... I'd suggest just documenting it and leaving it.

-- 
Nicholas Riley <[EMAIL PROTECTED]> | <http://www.uiuc.edu/ph/www/njriley>
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to