Re: to get handle to "File/1.jpg"
Re: to get handle to "File/1.jpg"
- Subject: Re: to get handle to "File/1.jpg"
- From: Gregory Weston <email@hidden>
- Date: Wed, 26 Nov 2008 11:41:14 -0500
Michael Ash wrote:
Hi,
How do I obtain a NSFileHandle to this file which has a forward
slash in the
name to be able to write to this file.
Supplying the path to NSFileHandle with filename in quotes also
fails.
Filenames cannot have slashes in them. If you think that your file has
one, then you are wrong. Very likely you think that it does because
Finder or other GUI apps are showing it to you that way. This is a
lie. A file which they display as having a / actually has a :, and the
character has been swapped dynamically. The slash is reserved as the
path separator and cannot be used as part of a filename.
Nonsense. What's "actually" there depends on the underlying file
system. If the file is on an HFS-variant volume there can be a slash
in the name (but can't be a colon). If that wasn't the case it would
be impossible to share media meaningfully with pre-X Mac OS and other
software that reads HFS. The various file system APIs do the
translation as necessary between colon and slash. The OP's issue is
not that the name doesn't really have a slash in it; it's that he's
using an API that expects POSIX style paths.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden