[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] UnmountVol?



At 15.16 1998.02.10, Matthias Ulrich Neeracher wrote:
>Kevin Walker <kwalker@euclid.ucsd.edu> writes:
>>How does one unmount a volume in MacPerl?  UnmountVol doesn't seem to be in
>>Files.pm.
>
>For now, you'll probably have to find an XCMD. It will be implemented in the
>next release.

You can use Apple Events.  This will not unmount a local hard drive; I
think the Finder rejects the request because it requires user confirmation.
But it will unmount removable media and shared volumes.

#!perl -wl
use Mac::AppleEvents;
use Mac::Files;

$disk = NewAliasMinimal('Extrasa:');
$obj1 = "obj {want:type(cdis), from:null(), form:enum(indx), seld:alis(\@\@)}";
$obj2 = "obj {want:type(prop), from:null(), form:enum(prop), seld:type(trsh)}";

$evt = AEBuildAppleEvent('core', 'move', 'sign', 'MACS', 0, 0,
  "'----':$obj1, insh:$obj2", $disk
) or die ($^E);
$rep = AESend($evt, kAEWaitReply()) or die ($^E);

AEDisposeDesc($evt);
AEDisposeDesc($rep);

__END__

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==               New Book:  MacPerl: Power and Ease               ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch