cocoa file APIs
cocoa file APIs
- Subject: cocoa file APIs
- From: Roland King <email@hidden>
- Date: Fri, 13 Mar 2009 21:44:55 +0800
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@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