FROM : Howard Oakley
DATE : Mon Oct 21 20:30:34 2002
On 21/10/02 19:19, Lorenzo Puleo wrote:
> 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.
Lorenzo,
The error is that you cannot and must not put a slash in a filename in OS X.
(Yes, I know that some things in the past have done so, but this has from
the Public Beta been a bad move.)
This is because the slash is the BSD separator in paths. OS X is unable to
distinguish between a file called this/that and a file called that in the
folder this.
The same applies to OS X's other separator (from its Mac heritage), the
colon - it also causes confusion in paths.
If you want to verify this, try editing a file name in the Finder (in Jaguar
or later - 10.0 and 10.1 did not object so strongly!) to contain these
characters.
One other character to avoid is a trailing hash # followed by anything that
could appear to be hexadecimal, e.g. this#dead - this is a bug affecting
10.2 and 10.2.1, though, and not intentional.
Howard.
Dr Howard Oakley * <email_removed>
EHN & DIJ Oakley * <email_removed>
Brooklands Lodge * GPRS email <email_removed>
Park View Close * mobile (& SMS) +44 7811 326837
Wroxall, Ventnor * home voice +44 1983 853605
Isle of Wight, PO38 3EQ, UK * http://www.quercus.demon.co.uk
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Mon Oct 21 20:30:34 2002
On 21/10/02 19:19, Lorenzo Puleo wrote:
> 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.
Lorenzo,
The error is that you cannot and must not put a slash in a filename in OS X.
(Yes, I know that some things in the past have done so, but this has from
the Public Beta been a bad move.)
This is because the slash is the BSD separator in paths. OS X is unable to
distinguish between a file called this/that and a file called that in the
folder this.
The same applies to OS X's other separator (from its Mac heritage), the
colon - it also causes confusion in paths.
If you want to verify this, try editing a file name in the Finder (in Jaguar
or later - 10.0 and 10.1 did not object so strongly!) to contain these
characters.
One other character to avoid is a trailing hash # followed by anything that
could appear to be hexadecimal, e.g. this#dead - this is a bug affecting
10.2 and 10.2.1, though, and not intentional.
Howard.
Dr Howard Oakley * <email_removed>
EHN & DIJ Oakley * <email_removed>
Brooklands Lodge * GPRS email <email_removed>
Park View Close * mobile (& SMS) +44 7811 326837
Wroxall, Ventnor * home voice +44 1983 853605
Isle of Wight, PO38 3EQ, UK * http://www.quercus.demon.co.uk
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Lorenzo Puleo | Oct 21, 20:19 | |
| Howard Oakley | Oct 21, 20:30 | |
| Ondra Cada | Oct 21, 20:38 | |
| Ondra Cada | Oct 21, 20:39 | |
| Josh Ferguson | Oct 21, 20:39 | |
| Finlay Dobbie | Oct 21, 20:47 | |
| Ondra Cada | Oct 21, 22:27 | |
| Howard Oakley | Oct 21, 22:30 | |
| Ondra Cada | Oct 22, 00:03 | |
| Pierre-Olivier Lat… | Oct 22, 00:15 | |
| Rosyna | Oct 22, 00:34 | |
| Rosyna | Oct 22, 00:41 | |
| Charles Srstka | Oct 22, 04:40 | |
| Lorenzo Puleo | Oct 22, 10:11 |






Cocoa mail archive

