• 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: newb- Overwriting a file or folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newb- Overwriting a file or folder


  • Subject: Re: newb- Overwriting a file or folder
  • From: Mike Abdullah <email@hidden>
  • Date: Tue, 1 Jul 2008 15:03:51 +0100


On 1 Jul 2008, at 13:57, Chris Paveglio wrote:

Newb alert.

I'm trying to copy some files and folders from one location to another. I would like to overwrite them at the destination. Is this possible yet?

[theManager copyPath:theSettings toPath:theDestinationFile handler:nil];

I've read the documentation: "The file specified in source must exist, while destination must not yet exist." and also see this older post regarding it: http://www.cocoabuilder.com/archive/message/cocoa/2005/3/30/131694

But that was a while ago (2005). Has this function been added in xCode 3/Obj-C 2? I'm working on 10.4.11 with xCode 2.5 but I also have 10.5/xC3 at home, but I'm not in front of it right now.

FWIW, Applescript makes it incredibly easy:
move folder "Safari" of folder myImport to folder "Library" of folder myUserFolder with replacing


Is the only viable option to force-delete any files/folders already there [removeFileAtPath:handler:]?

Correct, you must first delete them using removeFileAtPath: or send them to the Trash with NSWorkspace. Of course, if this is something your code is doing often, you could write a category method to simplify it.


Thanks, Chris




_______________________________________________

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

_______________________________________________

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: 
 >newb- Overwriting a file or folder (From: Chris Paveglio <email@hidden>)

  • Prev by Date: Re: Trying to display a static image on my window. Any tips would be great
  • Next by Date: Re: Process app.
  • Previous by thread: newb- Overwriting a file or folder
  • Next by thread: Correct Order for CFRelease-ing CFNetwork Refs?
  • Index(es):
    • Date
    • Thread