Skip navigation.
 
mlRe: Renaming files?
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.

Related mailsAuthorDate
mlRenaming files? Christoffer Lerno Dec 20, 18:01
mlRe: Renaming files? Clark Cox Dec 20, 20:10
mlRe: Renaming files? Jeremy Dronfield Dec 20, 23:11
mlRe: Renaming files? Brendan Younger Dec 20, 23:29
mlRe: Renaming files? Andrew Farmer Dec 21, 00:04
mlRe: Renaming files? Christoffer Lerno Dec 21, 12:20
mlRe: Renaming files? Clark Cox Dec 21, 15:27
mlRe: Renaming files? Christoffer Lerno Dec 22, 10:41
mlRe: Renaming files? Christoffer Lerno Dec 22, 10:56
mlRe: Renaming files? Jeremy Dronfield Dec 22, 15:03
mlRe: Renaming files? Clark Cox Dec 22, 17:30
mlRe: Renaming files? Clark Cox Dec 22, 17:35
mlRe: Renaming files? Jeremy Dronfield Dec 22, 18:54
mlRe: Renaming files? Christoffer Lerno Dec 22, 20:03
mlRe: Renaming files? Christoffer Lerno Dec 22, 20:10
mlRe: Renaming files? Clark Cox Dec 22, 20:30
mlRe: Renaming files? Andreas Mayer Dec 22, 20:35
mlRe: Renaming files? Clark Cox Dec 22, 21:04
mlRe: Renaming files? Christoffer Lerno Dec 23, 10:53