FROM : Brendan Younger
DATE : Mon Dec 20 23:29:14 2004
On Dec 20, 2004, at 4:11 PM, Jeremy Dronfield wrote:
>
> On 20 Dec 2004, at 5:01 pm, Christoffer Lerno wrote:
>
>> I thought I had renaming files nailed down by using NSFileManager's
>> movePath:toPath:handler: but it has problems with spaces & non ascii
>> characters in filenames - the documentation unfortunately doesn't
>> reveal how this is circumvented.
>
> In my experience, the only character -movePath:toPath:handler: can't
> cope with is a "/". It's possible, using the Finder, to put a slash in
> a filename, and NSFileManager interprets it as a path separator.
> (There may even be a way round this, but I haven't looked. I know
> Carbon can cope with it.)
The path separator on HFS(+) is ":", so trying to place a ":" in a name
in the Finder will fail; whereas, if you're using POSIX or Cocoa APIs,
you can place a ":" in the name with impunity. This is because, on an
HFS(+) volume, the POSIX APIs translate all occurrences of "/" in a
node name to ":" and vice-versa for Carbon calls on non-HFS(+) volumes.
[1] Essentially, the level of API you're using determines whether ":"
or "/" is a path separator or just a regular character. (Curse in-band
delimiters!)
Brendan Younger
[1] It should be noted that full paths in Carbon file manager functions
are really quite rare, so this isn't nearly so much of a headache on
the Carbon side.
DATE : Mon Dec 20 23:29:14 2004
On Dec 20, 2004, at 4:11 PM, Jeremy Dronfield wrote:
>
> On 20 Dec 2004, at 5:01 pm, Christoffer Lerno wrote:
>
>> I thought I had renaming files nailed down by using NSFileManager's
>> movePath:toPath:handler: but it has problems with spaces & non ascii
>> characters in filenames - the documentation unfortunately doesn't
>> reveal how this is circumvented.
>
> In my experience, the only character -movePath:toPath:handler: can't
> cope with is a "/". It's possible, using the Finder, to put a slash in
> a filename, and NSFileManager interprets it as a path separator.
> (There may even be a way round this, but I haven't looked. I know
> Carbon can cope with it.)
The path separator on HFS(+) is ":", so trying to place a ":" in a name
in the Finder will fail; whereas, if you're using POSIX or Cocoa APIs,
you can place a ":" in the name with impunity. This is because, on an
HFS(+) volume, the POSIX APIs translate all occurrences of "/" in a
node name to ":" and vice-versa for Carbon calls on non-HFS(+) volumes.
[1] Essentially, the level of API you're using determines whether ":"
or "/" is a path separator or just a regular character. (Curse in-band
delimiters!)
Brendan Younger
[1] It should be noted that full paths in Carbon file manager functions
are really quite rare, so this isn't nearly so much of a headache on
the Carbon side.
| Related mails | Author | Date |
|---|---|---|
| Christoffer Lerno | Dec 20, 18:01 | |
| Clark Cox | Dec 20, 20:10 | |
| Jeremy Dronfield | Dec 20, 23:11 | |
| Brendan Younger | Dec 20, 23:29 | |
| Andrew Farmer | Dec 21, 00:04 | |
| Christoffer Lerno | Dec 21, 12:20 | |
| Clark Cox | Dec 21, 15:27 | |
| Christoffer Lerno | Dec 22, 10:41 | |
| Christoffer Lerno | Dec 22, 10:56 | |
| Jeremy Dronfield | Dec 22, 15:03 | |
| Clark Cox | Dec 22, 17:30 | |
| Clark Cox | Dec 22, 17:35 | |
| Jeremy Dronfield | Dec 22, 18:54 | |
| Christoffer Lerno | Dec 22, 20:03 | |
| Christoffer Lerno | Dec 22, 20:10 | |
| Clark Cox | Dec 22, 20:30 | |
| Andreas Mayer | Dec 22, 20:35 | |
| Clark Cox | Dec 22, 21:04 | |
| Christoffer Lerno | Dec 23, 10:53 |






Cocoa mail archive

