Just trying to figure out what the best APIs are to use for some pretty simple file operations. I've found NSFileHandle, NSFileManager, or I could use low-level C-apis or a combination of the two.

What I want to do is create and write binary files (and I guess read them again later). I'd also like to be able to create temporary files in whatever the proper temporary location is, use them and delete them (or have them auto-delete)

seems like NSFileHandle fileHandleForWritingAtPath: doesn't create the file if it doesn't exist so I have to open it first with a open() and wrap it or use NSFileManager createFileAtPath:contents:attributes .. however I don't actually have any contents at this point (I'm going to be creating it later) and wanted some control over whether files are replaced etc. so open() actually looks better for this.

I was trying to find an API which gives me the correct path for temporary files, or even a temporary filename, but haven't found one.

Am I looking at the right APIs and thinking about this the right way, or are there some other cocoa classes I should be looking at. I'll happily use open() etc but wanted something higher-level and insulated from the filesystem if cocoa provides it. _______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to