Re: FSSpec from NSString Problems
Re: FSSpec from NSString Problems
- Subject: Re: FSSpec from NSString Problems
- From: Mike Shields <email@hidden>
- Date: Sun, 26 Jan 2003 14:00:20 -0700
Ah, I see the problem. -43 is fnfErr (File Not Found Error). You're
going to be creating a new file, so it currently does not exist. FSRefs
have to point to existing files and can't point to a file that WILL be
created like FSSpecs can. So what you'll need to do is to first create
the file using the path and Cocoa, then once the file's present and
accounted for, do the path conversion, etc
Mike
On Sunday, January 26, 2003, at 01:17 PM, Jonathan Sick wrote:
An example of an NSString returned by by NSSavePanel would be:
/Users/jsick/Movies/myMovie.mov
So when I do:
OSStatus status = FSPathMakeRef((unsigned const char *)[inPath
fileSystemRepresentation],&fsref, NULL);
The FSPathMakeRef returns an OSStatus value of -43. I'm not familiar
at all with OSStatus definitions. I did a search on Apple's site, but
couldn't find any info on a -43 error. Any pointers to documentation
on this error?
Jonathan
On Sunday, January 26, 2003, at 03:13 AM, Rosyna wrote:
Do you happen to know what the error is? And the path?
Ack, at 1/26/03, Jonathan Sick said:
But when I compile this from within Codewarrior 8.3, I get an error
that [inPath fileSystemRepresentation] returns a const char *, while
the FSPathMakeRef wants an unsigned const char *. I tried casting to
(unsigned const char *), and although this did compile, it printed
out "makeFSSpec error" in runtime. I'm not sure if casting was the
correct course of action, it just seemed like a natural remedy from
my original background in Java.
_______________________________________________
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.
_______________________________________________
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.