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 | |
|
|
6 | #use Coro::Multicore; |
|
|
7 | |
|
|
8 | use strict; |
5 | |
9 | |
6 | use Convert::UUlib ':all'; |
10 | use Convert::UUlib ':all'; |
7 | |
11 | |
8 | sub namefilter { |
12 | sub namefilter { |
9 | my ($path) = @_; |
13 | my ($path) = @_; |
… | |
… | |
20 | 0 |
24 | 0 |
21 | } |
25 | } |
22 | |
26 | |
23 | SetOption OPT_RBUF, 128*1024; |
27 | SetOption OPT_RBUF, 128*1024; |
24 | SetOption OPT_WBUF, 1024*1024; |
28 | SetOption OPT_WBUF, 1024*1024; |
25 | SetOption OPT_IGNMODE, 1; |
|
|
26 | SetOption OPT_IGNMODE, 1; |
29 | SetOption OPT_IGNMODE, 1; |
27 | SetOption OPT_VERBOSE, 1; |
30 | SetOption OPT_VERBOSE, 1; |
28 | SetOption OPT_DOTDOT, 1; |
31 | SetOption OPT_DOTDOT, 1; |
29 | SetOption OPT_AUTOCHECK, 0; |
32 | SetOption OPT_AUTOCHECK, 0; |
30 | |
33 | |
… | |
… | |
86 | Smerge -1; |
89 | Smerge -1; |
87 | |
90 | |
88 | SetOption OPT_SAVEPATH, "uudst/"; |
91 | SetOption OPT_SAVEPATH, "uudst/"; |
89 | |
92 | |
90 | # now wade through all files and their source parts |
93 | # now wade through all files and their source parts |
91 | $i = 0; |
94 | for my $uu (GetFileList) { |
92 | while ($uu = GetFileListItem $i) { |
95 | print "file ", $uu->filename, "\n"; |
93 | $i++; |
|
|
94 | print "file nr. $i"; |
|
|
95 | print " state ", $uu->state; |
96 | print " state ", $uu->state, "\n"; |
96 | print " mode ", $uu->mode; |
97 | print " mode ", $uu->mode, "\n"; |
97 | print " uudet ", strencoding $uu->uudet; |
98 | print " uudet ", strencoding $uu->uudet, "\n"; |
98 | print " size ", $uu->size; |
99 | print " size ", $uu->size, "\n"; |
99 | print " filename ", $uu->filename; |
|
|
100 | print " subfname ", $uu->subfname; |
100 | print " subfname ", $uu->subfname, "\n"; |
101 | print " mimeid ", $uu->mimeid; |
101 | print " mimeid ", $uu->mimeid, "\n"; |
102 | print " mimetype ", $uu->mimetype; |
102 | print " mimetype ", $uu->mimetype, "\n"; |
103 | print "\n"; |
|
|
104 | |
103 | |
105 | # print additional info about all parts |
104 | # print additional info about all parts |
|
|
105 | print " parts"; |
106 | for ($uu->parts) { |
106 | for ($uu->parts) { |
107 | while (my ($k, $v) = each %$_) { |
107 | for my $k (sort keys %$_) { |
108 | print "$k > $v, "; |
108 | print " $k=$_->{$k}"; |
109 | } |
109 | } |
110 | print "\n"; |
110 | print "\n"; |
111 | } |
111 | } |
112 | |
112 | |
113 | print $uu->filename; |
|
|
114 | |
|
|
115 | $uu->remove_temp; |
113 | $uu->remove_temp; |
116 | |
114 | |
117 | print "<s", $uu->state, ">";#d# |
|
|
118 | if (my $err = $uu->decode) { |
115 | if (my $err = $uu->decode) { |
119 | print ", ", strerror $err, "\n"; |
116 | print " ERROR ", strerror $err, "\n"; |
120 | } else { |
117 | } else { |
121 | print ", saved as uudst/", $uu->filename, "\n"; |
118 | print " successfully saved as uudst/", $uu->filename, "\n"; |
122 | } |
119 | } |
123 | } |
120 | } |
124 | |
121 | |
125 | print "cleanup...\n"; |
122 | print "cleanup...\n"; |
126 | |
123 | |