• 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: Michael Ash <email@hidden>
  • Date: Thu, 26 Feb 2009 13:00:02 -0500

On Thu, Feb 26, 2009 at 12:52 PM, Mike Abdullah
<email@hidden> wrote:
> This sounds a very interesting thing to watch out for. Do you know how
> NSString's -fileSystemRepresentation method handles NUL characters? I'm
> thinking ideally it should strip them for you.

Ideally it should. Practically it doesn't. Instead it truncates it for
you. (More likely, it doesn't handle NUL at all and gives you the
entire string, but since it's a C string, it stops at the first NUL
and the remainder goes unused..)

> Is there a good way to
> reproduce this from the GUI, or is it best to test with hardcoded strings
> fed into the system like your example?

I couldn't think of a pure GUI example, but this bit of Terminality
will get you a nice test string you can paste into anything:

python -c 'import sys;sys.stdout.write("foo\x00bar")' | pbcopy

I tested it with Safari by saving my gmail page and pasting the result
into the save panel. "foobar" read the save panel, "foo" read the
resulting file. So it works fine to test.

Mike
_______________________________________________

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>)
 >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: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: renaming a file with special/reserved characters in name
  • Next by Date: Re: Radio Buttons not Selecting Properly
  • 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