App-RegexFileUtils
view release on metacpan or search on metacpan
share/ppt/cp.pl view on Meta::CPAN
while (read PATH, $buffer, 1024) { print TARGET $buffer; }
close PATH;
close TARGET;
if ($PRESERVE) ## preserve as many file attributes as possible...
{
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat $path;
utime $atime, $mtime, ($target);
chown $uid, $gid, ($target);
my $oldMode = (07777 & $mode); ## from man -s 2 mknod
chmod $oldMode, $target;
}
}
################################################################################
## print Insufficient arguments error
sub insufficientArgs($)
{
my $arg_num = ($_[0] + 1); ## num to display
print STDERR "cp: Insufficient arguments ($arg_num)\n";
$cp::EXIT_STATUS++;
share/ppt/rm.pl view on Meta::CPAN
if ( $reply =~ /^[Nn]/ )
{
return;
}
}
# If we are forcing the delete first change the files mode to allow writes.
if ( $opt_f )
{
my ( $mode ) = "0777";
chmod $mode, $fileName;
}
# Overwrite the file with rubbish before deleting.
if ( $opt_P )
{
overWriteFile( $fileName );
}
# Delete the file.
unlink( $fileName );
share/ppt/rm.pl view on Meta::CPAN
# We only want the size
( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size ) = stat $fileName;
$ff = "\0xFF";
# Change mode if the file is readonly.
if ( !-w $fileName )
{
my ( $mode ) = "0777";
chmod $mode, $fileName;
}
## First pass at overwrite
if ( open (FILEHANDLE, ">$fileName" ) )
{
$text = $ff x $size;
print FILEHANDLE $text;
close ( FILEHANDLE );
}
( run in 0.343 second using v1.01-cache-2.11-cpan-496ff517765 )