Re: Rename files containing a slash
Re: Rename files containing a slash
- Subject: Re: Rename files containing a slash
- From: Pierre-Olivier Latour <email@hidden>
- Date: Mon, 21 Oct 2002 15:15:32 -0700
>
Hi,
>
I'm trying to rename a file using a new filename containing a slash.
>
Since I can't find a Cocoa API that renames files I use the Carbon API:
>
err = FSRenameUnicode(&destRef, nameLength, name, theInfo.textEncodingHint,
>
nil);
>
>
Each time the fileName proposed contains a slash (that Finder accepts) this
>
API returns an error. Please may someone help me to fix the trouble?
>
Thank you.
Try replacing the '/' character with a ':'.
Carbon does not allow ':' in a file name because it's the path separator,
but does allow '/'. It's the reverse for Cocoa.
Using this tip I was able to rename file with '/' character in their name
through the UNIX rename() function.
_____________________________________________________________
Pierre-Olivier Latour email@hidden
Lausanne, Switzerland
http://www.pol-online.net
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.