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

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


  • Subject: Re: NSFileManager and making sure you don't overwrite existing files 10.5
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Fri, 18 Jan 2008 16:41:35 +0100


Le 18 janv. 08 à 16:00, Jonathan Dann a écrit :

Thanks glenn I appreciate the quick reply, I thought that the multitasking would be the reason.

Will that be the same way the save panel will work when it notifies the user that a file will be overwritten? Its already written the file to /tmp and then will be moving it?

Should I use /tmp or create a folder for my app in ~/Library/ Application Support?

Jonathan Dann

On 18 Jan 2008, at 14:50, glenn andreas <email@hidden> wrote:


Quote from "http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/Articles/WhereToPutFiles.html "
Mac OS X provides an established set of directories for storing temporary files. The primary directory (/tmp) is where most local files go, but you should never hardcode this path into your application. Using hardcoded paths limits the portability and longevity of your code. Instead, Carbon applications should use the FSFindFolder function (in the Core Services framework) to obtain a reference to the temporary directory; Cocoa applications should use the NSTemporaryDirectory function in Foundation Kit.


In your case, you may want to create your file on the same volume to be able to really move it and not have to copy/delete it (the move operation will take care of this transparently but if you move big file, it may have some performance impact).

Else I don't think you can locate a temporary directory on a defined volume using Cocoa functions, but Carbon File Manager can do it (using FSFindFolder with the target volume reference as first parameter).


_______________________________________________

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: 
 >NSFileManager and making sure you don't overwrite existing files 10.5 (From: Jonathan Dann <email@hidden>)
 >Re: NSFileManager and making sure you don't overwrite existing files 10.5 (From: glenn andreas <email@hidden>)
 >Re: NSFileManager and making sure you don't overwrite existing files 10.5 (From: Jonathan Dann <email@hidden>)

  • Prev by Date: App-specific URLs and the pasteboard. Need help.
  • Next by Date: Re: App-specific URLs and the pasteboard. Need help.
  • Previous by thread: Re: NSFileManager and making sure you don't overwrite existing files 10.5
  • Next by thread: NSTextField selected
  • Index(es):
    • Date
    • Thread