ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-UUlib/example-decoder
(Generate patch)

Comparing Convert-UUlib/example-decoder (file contents):
Revision 1.19 by root, Mon Aug 24 04:38:23 2009 UTC vs.
Revision 1.22 by root, Fri Feb 28 06:57:25 2020 UTC

1#!/usr/bin/perl 1#!/usr/bin/perl
2 2
3# decode all the files in the directory uusrc/ and copy 3# decode all the files in the directory uusrc/ and copy
4# the resulting files to uudst/ 4# the resulting files to uudst/
5
6use Coro::Multicore;
5 7
6use Convert::UUlib ':all'; 8use Convert::UUlib ':all';
7 9
8sub namefilter { 10sub namefilter {
9 my ($path) = @_; 11 my ($path) = @_;
20 0 22 0
21} 23}
22 24
23SetOption OPT_RBUF, 128*1024; 25SetOption OPT_RBUF, 128*1024;
24SetOption OPT_WBUF, 1024*1024; 26SetOption OPT_WBUF, 1024*1024;
25SetOption OPT_IGNMODE, 1;
26SetOption OPT_IGNMODE, 1; 27SetOption OPT_IGNMODE, 1;
27SetOption OPT_VERBOSE, 1; 28SetOption OPT_VERBOSE, 1;
28SetOption OPT_DOTDOT, 1; 29SetOption OPT_DOTDOT, 1;
29SetOption OPT_AUTOCHECK, 0; 30SetOption OPT_AUTOCHECK, 0;
30 31
81for(<uusrc/*>) { 82for(<uusrc/*>) {
82 my ($retval, $count) = LoadFile ($_, $_, 1); 83 my ($retval, $count) = LoadFile ($_, $_, 1);
83 print "file($_), status(", strerror $retval, ") parts($count)\n"; 84 print "file($_), status(", strerror $retval, ") parts($count)\n";
84} 85}
85 86
86CheckGlobalList; 87Smerge -1;
87 88
88SetOption OPT_SAVEPATH, "uudst/"; 89SetOption OPT_SAVEPATH, "uudst/";
89 90
90# now wade through all files and their source parts 91# now wade through all files and their source parts
91$i = 0; 92$i = 0;
112 113
113 print $uu->filename; 114 print $uu->filename;
114 115
115 $uu->remove_temp; 116 $uu->remove_temp;
116 117
118 print "<s", $uu->state, ">";#d#
117 if (my $err = $uu->decode) { 119 if (my $err = $uu->decode) {
118 print ", ", strerror $err, "\n"; 120 print ", ", strerror $err, "\n";
119 } else { 121 } else {
120 print ", saved as uudst/", $uu->filename, "\n"; 122 print ", saved as uudst/", $uu->filename, "\n";
121 } 123 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines