• 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: Possible Bug in NSFileManager -moveItemAtPath:toPath:error:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible Bug in NSFileManager -moveItemAtPath:toPath:error:


  • Subject: Re: Possible Bug in NSFileManager -moveItemAtPath:toPath:error:
  • From: Jonathan Dann <email@hidden>
  • Date: Sat, 31 May 2008 22:35:46 +0100


On 31 May 2008, at 18:17, Jens Alfke wrote:


On 31 May '08, at 9:27 AM, Jonathan Dann wrote:

Just a quick one. I would expect renaming a file named HELLO.TXT to hello.txt (or another variant where the case of a few letters change) with -moveItemAtPath:toPath:error: to be allowed. As it is not (it generates an NSFileWriteUnknownError) is this a bug or just me?

That ought to work, even on HFS+. (It's not a no-op, because HFS+ preserves the case of filenames, so getting the directory contents will return the name in its new case.)


If not, is there are more appropriate API for renaming files?

Try using the system call "rename". (Use "man 2 rename" to see the documentation.)
Call -fileSystemRepresentation on your path strings to convert them to appropriate C strings.


—Jens

I'll have a look at that, would that break if my users have non-ascii filenames? I've only worked with NString, which handles Unicode transparently.


Thanks Jens,

Jon

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Possible Bug in NSFileManager -moveItemAtPath:toPath:error:
      • From: "stephen joseph butler" <email@hidden>
References: 
 >Possible Bug in NSFileManager -moveItemAtPath:toPath:error: (From: Jonathan Dann <email@hidden>)
 >Re: Possible Bug in NSFileManager -moveItemAtPath:toPath:error: (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Possible Bug in NSFileManager -moveItemAtPath:toPath:error:
  • Next by Date: Re: Opening column for edit after adding to tree controller?
  • Previous by thread: Re: Possible Bug in NSFileManager -moveItemAtPath:toPath:error:
  • Next by thread: Re: Possible Bug in NSFileManager -moveItemAtPath:toPath:error:
  • Index(es):
    • Date
    • Thread