home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Acorn User 10
/
AU_CD10.iso
/
Updates
/
Perl
/
RPC
/
!Perl
/
scripts
/
rm
< prev
next >
Wrap
Text File
|
1998-07-14
|
587b
|
40 lines
#! perl
use RISCOS::Filespec;
use RISCOS::File qw(globlist);
use Getopt::Std;
getopts('r');
die "$0 [-r] [files]" unless @ARGV;
&rm (globlist( @ARGV ));
$fails = 0;
sub rm
{
foreach( @_ )
{
if( $opt_r && -d $_ )
{
rm( glob "$_.*" );
unless( rmdir $_ )
{
warn "$_ $!\n";
$fails++;
}
}
else
{
unless( unlink $_ )
{
warn "$_ $!\n";
$fails++;
}
}
}
}
$fails != 0;