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

Re: [MacPerl] Deleting files & interaction with AppleScript



Chris Nandor wrote:
> <snip>
> Second, unlink() does work fine in MacPerl.  Did you check the result of
> the unlink()?  Did Perl for Dummies tell you to check the error?
> 
>   unlink($file) or die "Can't unlink $file: $!";
> 
> Chances are that you have the wrong path or something.  unlink() does work
> fine.

when I run:

   #!/usr/local/bin/perl
   require "GUSI.ph"; require "StandardFile.pl"; require "FileCopy.pl"; 
   #yes, I know there are extra requires

   $file = &StandardFile'GetFolder("Choose a folder to kill.");
   unlink($file) or die "Can't unlink $file: $!";

MacPerl returns:

   # Can't unlink Phred:Desktop Folder:Trash me: .
   File 'Untitled'; Line 5

What am I doing wrong?

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