• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: renaming a file with special/reserved characters in name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: renaming a file with special/reserved characters in name


  • Subject: Re: renaming a file with special/reserved characters in name
  • From: Mike Abdullah <email@hidden>
  • Date: Thu, 26 Feb 2009 12:39:18 +0000


On 26 Feb 2009, at 07:29, Martin Wierschin wrote:

Hi Michael,

I appreciate your reply, thank you.

The first is the slash (/). Note, NOT a backslash (\), that one is
fine. Slash is the path separator and thus can't exist in a filename.

Whoops, quite right, my mistake.

Except it doesn't, because each filesystem is different. The above is
true for HFS+, it is NOT true for FAT32, which has a whole bunch of
other characters which are illegal.

This is the bad news: there is NO way to tell what those characters are.

It seems totally crazy that there isn't an API for this, Cocoa or not. Oh well, obviously one must code to handle a failure in the rename operation, so this actually simplifies my task. I still have to hardcode the magic conversion of slashes to colons- a shame.

I suppose you could argue that there is sort of an API, trying to use the filename and see if it fails. I think the main point is that the way some file systems work means you can't determine failure without trying first. Plus, presumably users may then either choose to change the filename or save it elsewhere.
_______________________________________________


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


References: 
 >renaming a file with special/reserved characters in name (From: Martin Wierschin <email@hidden>)
 >Re: renaming a file with special/reserved characters in name (From: Michael Ash <email@hidden>)
 >Re: renaming a file with special/reserved characters in name (From: Martin Wierschin <email@hidden>)

  • Prev by Date: Re: One IBAction, multiple results from multiple methods
  • Next by Date: noobie mem management problem
  • Previous by thread: Re: renaming a file with special/reserved characters in name
  • Next by thread: Re: renaming a file with special/reserved characters in name
  • Index(es):
    • Date
    • Thread