• 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: moving file by NSFileManager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: moving file by NSFileManager


  • Subject: Re: moving file by NSFileManager
  • From: Stephane Sudre <email@hidden>
  • Date: Thu, 27 May 2004 13:03:50 +0200

On mercredi, mai 26, 2004, at 06:23 PM, Brad O'Hearne wrote:

Does this advice apply for copying a file as well? Is Cocoa not up to the task?

and:

On mercredi, mai 26, 2004, at 06:42 PM, Chris Parker wrote:

On May 26, 2004, at 3:10 AM, Stephane Sudre wrote:

On mercredi, mai 26, 2004, at 10:17 AM, Ramakrishna Kondapalli wrote:

Hi,
I am using NSFileManager's method
[[NSFileManager defaultManager] movePath:source toPath:destination
handler:nil];
to move a file from one Dir to another Dir. I am able to see the file
content. Why the comments (Finder info comments) associated with the
source file are missing at the destination?

Probably both the comments and the resource forks.

I don't think NSFileManager is "Mac OS savy" on this point. Carbon might be a better solution in this case.

NSFileManager preserves resources forks on copies since Mac OS X 10.1.

Finder comments are not preserved at this time.

Ouch, I think my head hit the ceiling a bit stronger than I previously thought. Indeed, resource forks are copied.

Anyway, my experiments with NSFileManager as a "copy" solution are not 100% successful. For instance, I faced situation where NSFileManager is not able to copy a complex hierarchy of files on 10.2 because of a file name including a '/' (from the HSF point of view) whereas it was working a bit better on 10.3.

I switched to the (Carbon) FSCopyObject sample code solution since because with some little bug fixes in the code, it's working for all the cases I tested and on both 10.2 and 10.3.
_______________________________________________
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.


  • Prev by Date: Re: How far with accessors?
  • Next by Date: Re: NSURLRequest and HTTP PUT?
  • Previous by thread: Re: moving file by NSFileManager
  • Next by thread: Problem with NSOutlineView outlineView:willDisplayCell:forTableColumn:item: delegate method
  • Index(es):
    • Date
    • Thread