• 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: Problem with NSFileManager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with NSFileManager


  • Subject: Re: Problem with NSFileManager
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 2 Sep 2009 12:33:46 -0700


On Sep 2, 2009, at 11:50 AM, K. Chen wrote:

Then my code tries to copy the file over from the bundle; note the the destination is under <app_home>/Documents.

if (![fileManager copyItemAtPath:configFilePath toPath:myConfigDir error:&err])  
Here I got the error message from [NSError localizedDescription] saying: Operation could not be completed. File exists. 

You were checking the existence of 'myConfigFile'. But here the destination is 'myConfigDir'; that directory exists.
You have to specify the full path of the destination, including the filename. It's not like the 'cp' command.

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

This email sent to email@hidden

References: 
 >Problem with NSFileManager (From: "K. Chen" <email@hidden>)

  • Prev by Date: Re: recompile without -mlong-branch?
  • Next by Date: Re: Xcode 3.2 fails to highlight errors in Java source
  • Previous by thread: Problem with NSFileManager
  • Next by thread: Re: PyObjc Cocoa Applications in Xcode 3.2?
  • Index(es):
    • Date
    • Thread