• 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: duplicate a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: duplicate a file


  • Subject: Re: duplicate a file
  • From: Prachi Gauriar <email@hidden>
  • Date: Wed, 28 Dec 2005 14:52:42 -0600

On Dec 28, 2005, at 8:15 AM, Bas Scheffers wrote:
Francesca P said:
I've to duplicate a file in my desktop to another folder... in my cocoa apps.
I'm able to do this with applescript.
And I can use applescript in cocoa, I have no problem.
But it is slow......
Can I use another method in cocoa to do this???

Yes, you can do it using NSFileManager's -copyPath:toPath:handler:

Or perhaps better, check out NSWorkspace's - performFileOperation:source:destination:files:tag: using either NSWorkspaceCopyOperation or NSWorkspaceDuplicateOperation, depending on your needs. This will more accurately mimic the Finder's operation.

-Prachi
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >RE: duplicate a file (From: "Bas Scheffers" <email@hidden>)

  • Prev by Date: Re: Agent Applications and launchd
  • Next by Date: NSURLConnection Crash Help Needed
  • Previous by thread: RE: duplicate a file
  • Next by thread: looking for a cocoa programmer ( paid job )
  • Index(es):
    • Date
    • Thread