[futurebasic] Re: [FB] Re: Programatical unmounting of volumes

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2003 : Group Archive : Group : All Groups

From: "Wolf, John" <jwolf@...>
Date: Mon, 10 Nov 2003 10:48:28 -0600
Ken, thanks for the suggestions, but still no go. With the following code,
the server mounts, and the output from your routine is "-1", and the server
doesn't unmount.

Now, with the server volume already mounted, if I comment out the mount
portion in the FB code and run, your routine lists all the volumes on the
desktop including the server and boot volume and the server unmounts.

And, as I mentioned, this same exact code run from the script editor behaves
exactly as you would expect. The volume mounts and unmounts.

SOMETHING in the FB code is preventing the unmount from within the same
application that mounted.

I looked at EJECT in FB, but I thought it didn't work in carbon.

I don't have any haxies installed. Norton Antivirus is off.

Here is the revised test code with your example code tossed in.

Thanks,
John


OUTPUT FILE "MountUnmount test"

include "Subs AppleScript.Incl"

#if ( CarbonLib == 0 ) or ( ndef _appearanceRuntime )
compile shutdown "Must be compiled as Appearance Compliant with Carbon"
#endif

END GLOBALS

local fn ListEjectableDisks$
dim as OSErr  err
dim as str255 messageStr

route _toAppleScript
print "tell application ""Finder"""
print "name of every disk of desktop whose ejectable is true"
print "end tell"
route _toScreen

err = usr AppleScriptRun( messageStr )
long if  err == _noErr
messageStr = messageStr
xelse
messageStr = Str$( err )
end if

end fn = messageStr

dim osErr%, message$

'mount the server volume
route _toAppleScript
print "mount volume ""afp://asip.temmc.com/MacUpdates"""
print _toScreen

osErr% = usr AppleScriptRun( message$ )

print fn ListEjectableDisks$

route _toAppleScript
print "tell application ""Finder"""
print "eject the disk ""MacUpdates"""
print "end tell"
route _toScreen

osErr% = usr AppleScriptRun( message$ )

include "Subs Quick Event Loop.Incl"

end