App-RegexFileUtils
view release on metacpan or search on metacpan
share/ppt/rm.pl view on Meta::CPAN
}
#
# Remove a file, asking for confirmation, etc, as
# necessary
sub removeFile( $fileName )
{
my ( $fileName ) = @_;
my $reply;
# If its read only, and we're not forcing, and interactive prompt for deletion
#
if ( ( ! -w $fileName ) && ( !$opt_f ) && ( $opt_i ))
{
print "$fileName: Read-only ? ";
$reply = <STDIN>;
if ( $reply =~ /^[Nn]/ )
{
return;
}
}
share/ppt/rm.pl view on Meta::CPAN
}
#
# Show the useage
sub showUsage()
{
print << "E-O-F";
Usage: rm [-fiPrR] file ...
The options are as follows:
-f Attempt to remove the files without prompting for confirmation, re-
gardless of the file's permissions. If the file does not exist, do
not display a diagnostic message or modify the exit status to re-
flect an error. The -f option overrides any previous -i options.
-i Request confirmation before attempting to remove each file, regard-
less of the file's permissions, or whether or not the standard in-
put device is a terminal. The -i option overrides any previous -f
options.
-P Overwrite regular files before deleting them. Files are overwrit-
ten three times, first with the byte pattern 0xff, then 0x00, and
then 0xff again, before they are deleted.
-R Attempt to remove the file hierarchy rooted in each file argument.
The -R option implies the -d option. If the -i option is speci-
fied, the user is prompted for confirmation before each directory's
contents are processed (as well as before the attempt is made to
remove the directory). If the user does not respond affirmatively,
the file hierarchy rooted in that directory is skipped.
The rm utility removes symbolic links, not the files referenced by the
links.
It is an error to attempt to remove the files ``.'' or ``..''.
E-O-F
exit;
( run in 1.604 second using v1.01-cache-2.11-cpan-6aa56a78535 )