Re: Server Path URL question
Re: Server Path URL question
- Subject: Re: Server Path URL question
- From: "Daniel Brieck Jr." <email@hidden>
- Date: Fri, 17 Aug 2007 00:59:16 -0400
Hello Quinn and all,
I am getting an error that is causing the assert after FSPathMakeRef
to fail when my Apple Script Studio calls the Objective-C method
below. I know what is causing the error but I am not sure why it is
happening?:
Here is what I have found:
If I run an Apple script to connect to a network drive my program works.
--The script ran:
tell application "Finder"
open location "cifs://MSHOME;DANIELBR@IBM_NETVISTA/MYVIDEOS"
end tell
At that point when I get [***] the URL for that disk it is "file://
localhost/Volumes/MYVIDEOS/" which of course is filtered down to "/
Volumes/MYVIDEOS/" before calling the Objective-C method given below.
Every thing works fine on this try.
If I use the Finder GO menu > Network > ... way to connect to the
volume and run my program, it crashes with the error given below.
Now the URL is "file://localhost/Volumes/MSHOME;IBM_NETVISTA/"
which is shortened to "/Volumes/MSHOME;IBM_NETVISTA/"
FROM the terminal at this point there are the following volumes :
[MacBook-semi-Pro:/Volumes] danielbr% ls
MYVIDEOS MSHOME;DELLINS8200
Macintosh HD MSHOME;IBM_NETVISTA
and from that I see that "MSHOME;IBM_NETVISTA" is a problem.
Why is it giving a different path when using the GO menu in the
Finder. Specifically the ";" , I am almost certain this is what is
causing the error? It May be some kind of Apple Script error too
which resutls in ";" being replaced with ";". Any ideas or
suggestions? I am guessing the ";" may be some kind of escape
sequence or something... Can anyone confirm that ";" is a constant
part of network volumes mounted through the GO menu.
If I manually type in an input string of "/Volumes/
MSHOME;IBM_NETVISTA/" the program works.
Thank you,
Daniel J. Brieck Jr.
<<The Error>>
[Session started at 2007-08-16 21:29:10 -0400.]
/Users/danielbr/Programs/Network Drive (Master)Maestro Files:
programs/Network Drive Launcher/getServerURL.m:25: failed assertion
`err == noErr'
Network Drive Launcher has exited due to signal 6 (SIGABRT).
***<< This is how I get the the "file://localhost... paths from the
"Finder"
tell application "Finder"
set theFileURL to URL of disk "MYVIDEOS"
end tell
On Aug 10, 2007, at 6:01 AM, Quinn wrote:
.
<<Objective-C method>>
- (NSString *) urlStringForServerVolume:(const char *) path
{
OSStatus err;
FSRef ref;
FSCatalogInfo catInfo;
CFURLRef url;
CFStringRef str;
NSString * result;
assert(path != NULL);
err = FSPathMakeRef( (const UInt8 *) path, &ref, NULL);
assert(err == noErr);
err = FSGetCatalogInfo(&ref, kFSCatInfoVolume, &catInfo,
NULL, NULL, NULL);
assert(err == noErr);
err = FSCopyURLForVolume(catInfo.volume, &url);
assert(err == noErr);
str = CFURLGetString(url);
assert(str != NULL);
result = [NSString stringWithString:(NSString *) str];
assert(result != nil);
CFRelease(url);
return result;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden