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

Re: [MacPerl] mounting network volumes



At 13.25 -0500 2000.03.24, Ken Cartner wrote:
>I'm working on a project that requires a particular network volume be
>mounted. I can test to see if it's mounted, but I can't figure out a way
>to mount it if the test returns false.
>
>Is it possible to mount volumes with MacPerl? I know you can call an
>Applescript script to do it, but I'm hoping that MacPerl can do it.

Using Mac::Glue, with Mac OS 9's scripting addition in Standard Additions,
you can do:

  use Mac::Glue;
  my $f = new Mac::Glue 'Finder';
  $f->mount_volume($volume, on_server => $server, as_user_name => $user,
    in_appletalk_zone => $zone, with_password => $password);

Previous to Mac OS 9 there was another OSAX called Mount Volume that had a
different syntax.  You can also use raw Apple events, which I won't put
here, or you can call AppleScript directly:

   MacPerl::DoAppleScript <<EOS;
mount volume "$volume" on server "$server" as user name "$user" -- etc.
EOS

-- 
Chris Nandor       |     pudge@pobox.com      |     http://pudge.net/
Andover.Net        | chris.nandor@andover.net | http://slashcode.com/

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org