Re: FSSpec to a non-existent file
Re: FSSpec to a non-existent file
- Subject: Re: FSSpec to a non-existent file
- From: "M. Uli Kusterer" <email@hidden>
- Date: Wed, 11 Jun 2003 22:59:31 +0200
The API that creates an archive requires a FSSpec to a new file that does
not exist yet.
I have scoured the documentation, but there does not seem to be a way of
getting a FSSpec from path that does not exist yet.
I have tried using NSFileManager to create a file first, but stuffIt
changes the name of the file if that file already exists.
Any ideas on how to get a FSSpec to a file that does not yet exist?
Have a look at FSMakeFSSpec(). You can pass in 0 for the parID and
vRefNum, and an HFS-style (colon-separated, starts at a volume) path
in the "name" parameter. However, that's limited to 255 characters...
You could also have a look at the MoreFilesX sample code by Jim
Luther (it's on Apple's web site). I'd be surprised if that didn't
contain a function that takes a path and generates an FSSpec from
that.
But be aware that FSSpecs are quite dated, and are limited to 31
characters for a file name. You may want to generate a temporary name
for your file and then rename it using a more modern API to get a
255-character name.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.