• 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
NSFileManager and making sure you don't overwrite existing files 10.5
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSFileManager and making sure you don't overwrite existing files 10.5


  • Subject: NSFileManager and making sure you don't overwrite existing files 10.5
  • From: Jonathan Dann <email@hidden>
  • Date: Fri, 18 Jan 2008 11:46:30 +0000

The NSFilManager.h file says that the -fileExistsAtPath: method is "of limited utility... encourages odd behaviour"

If I want to make sure that I'm not overwriting a file that's already on disk then should I really try loading the file so I get an error if it's not there?

This seems a little roundabout, are there better ways to check this?

With creating a directory the new method with an error is fine, and it doesn't overwrite an existing directory, but there doesn't seem to be an allegory for file creation.

Jonathan
_______________________________________________

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: NSFileManager and making sure you don't overwrite existing files 10.5
      • From: glenn andreas <email@hidden>
  • Prev by Date: Re: Creating a Cocoa Window in code
  • Next by Date: NSTextField selected
  • Previous by thread: Core Data & Bindings, [_NSStateMarker intValue] error
  • Next by thread: Re: NSFileManager and making sure you don't overwrite existing files 10.5
  • Index(es):
    • Date
    • Thread