On Wed, 03 Mar 1999 13:54:26 +0000, Jay Bedsole wrote: >Here's a totally un-portable, yet very mac-like alternative >to unlink'ing a file... dump them in the trash. >#!perl -w > >use Mac::Files; >FSpCatMove($ARGV[0], FindFolder(kOnSystemDisk, kTrashFolderType)); Which will (probably) only work if that file is on the systemdisk! That's what the "kOnSystemDisk" means, anyway. Here's how you can find the trash folder for any volume, based on a post from Chris Nandor on january 7th of this year (archives?), plus an updated version of the code here above: #! perl -w use Mac::Files; foreach $file (@ARGV) { my($volume) = /^([^:]+):)/ or die "No volume in $file"; my $volumenumber = hex(substr(MacPerl::MakeFSSpec($volume),1,4); my $trashfolder = FindFolder($volumenumber, kTrashFolderType, 1); # This creates it if it didn't exist print STDERR "Trash folder for volume '$volume' is $trashfolder\n"; # And now: FSpCatMove($file,$trashfolder); # will fail if # there's already a file with the same name in that trashcan } Bart. ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org