Convert-UUlib
view release on metacpan or search on metacpan
# now read all files in the directory uusrc/*
for (<uusrc/*>) {
my ($retval, $count) = LoadFile ($_, $_, 1);
print "file($_), status(", strerror $retval, ") parts($count)\n";
}
SetOption OPT_SAVEPATH, "uudst/";
# now wade through all files and their source parts
for my $uu (GetFileList) {
print "file ", $uu->filename, "\n";
print " state ", $uu->state, "\n";
print " mode ", $uu->mode, "\n";
print " uudet ", strencoding $uu->uudet, "\n";
print " size ", $uu->size, "\n";
print " subfname ", $uu->subfname, "\n";
print " mimeid ", $uu->mimeid, "\n";
print " mimetype ", $uu->mimetype, "\n";
# print additional info about all parts
print " parts";
for ($uu->parts) {
for my $k (sort keys %$_) {
print " $k=$_->{$k}";
}
print "\n";
}
$uu->remove_temp;
if (my $err = $uu->decode) {
print " ERROR ", strerror $err, "\n";
} else {
print " successfully saved as uudst/", $uu->filename, "\n";
}
}
print "cleanup...\n";
CleanUp;
PERLMULTICORE SUPPORT
This module supports the perlmulticore standard (see
<http://perlmulticore.schmorp.de/> for more info) for the following
functions - generally these are functions accessing the disk and/or
using considerable CPU time:
LoadFile
$item->decode
$item->decode_temp
$item->remove_temp
$item->info
The perl interpreter will be reacquired/released on every callback
invocation, so for performance reasons, callbacks should be avoided if
that is costly.
Future versions might enable multicore support for more functions.
BUGS AND LIMITATIONS
The original uulib library this module uses was written at a time where
main memory of measured in megabytes and buffer overflows as a security
thign didn't exist. While a lot of security fixes have been applied over
the years (includign some defense in depth mechanism that can shield
against a lot of as-of-yet undetected bugs), using this library for
security purposes requires care.
Likewise, file sizes when the uulib library was written were tiny
compared to today, so do not expect this library to handle files larger
than 2GB.
Lastly, this module uses a very "C-like" interface, which means it
doesn't protect you from invalid points as you might expect from "more
perlish" modules - for example, accessing a file item object after
callinbg "CleanUp" will likely result in crashes, memory corruption, or
worse.
AUTHOR
Marc Lehmann <schmorp@schmorp.de>, the original uulib library was
written by Frank Pilhofer <fp@informatik.uni-frankfurt.de>, and later
heavily bugfixed by Marc Lehmann.
SEE ALSO
perl(1), uudeview homepage at <http://www.fpx.de/fp/Software/UUDeview/>.
( run in 1.044 second using v1.01-cache-2.11-cpan-39bf76dae61 )