Subject: | use Mac::Carbon instead of Mac::AppleScript in Mac::Path::Util |
Perhaps for use in Mac::Path::Util:
$ perl -MMacPerl -le '$vol = MacPerl::Volumes(); $vol =~ s/^.+://; print$vol' Orr
Volumes() returns all mounted volumes in list context, and the startup
volume in scalar context. The paths returned text representations of
FSSpec data structures, which can be converted to native paths with
MacPerl::MakePath():
$ perl -MMacPerl=all -le 'print join "\n", map { MakePath($_) } Volumes()'
/
/Volumes/Bourque
/Volumes/Bird
/Volumes/Diablo II Play Disc
/Volumes/Diablo II Cinematics
(I just finished Diablo tonight, yay for me!)
But that is not too helpful for getting the startup volume name. You can,
however, merely strip off everything up to the ":" in the FSSpec to get the
volume name:
$ perl -MMacPerl -le 's/^.+://, print for MacPerl::Volumes()'
Orr
Bourque
Bird
Diablo II Play Disc
Diablo II Cinematics
It's a lot faster, and probably more reliable, than AppleScript.
MacPerl is a part of Mac::Carbon. Enjoy,