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; |
5 | |
7 | |
6 | use Convert::UUlib ':all'; |
8 | use Convert::UUlib ':all'; |
7 | |
9 | |
8 | sub namefilter { |
10 | sub namefilter { |
9 | my ($path) = @_; |
11 | my ($path) = @_; |
… | |
… | |
20 | 0 |
22 | 0 |
21 | } |
23 | } |
22 | |
24 | |
23 | SetOption OPT_RBUF, 128*1024; |
25 | SetOption OPT_RBUF, 128*1024; |
24 | SetOption OPT_WBUF, 1024*1024; |
26 | SetOption OPT_WBUF, 1024*1024; |
25 | SetOption OPT_IGNMODE, 1; |
|
|
26 | SetOption OPT_IGNMODE, 1; |
27 | SetOption OPT_IGNMODE, 1; |
27 | SetOption OPT_VERBOSE, 1; |
28 | SetOption OPT_VERBOSE, 1; |
28 | SetOption OPT_DOTDOT, 1; |
29 | SetOption OPT_DOTDOT, 1; |
29 | SetOption OPT_AUTOCHECK, 0; |
30 | SetOption OPT_AUTOCHECK, 0; |
30 | |
31 | |
… | |
… | |
81 | for(<uusrc/*>) { |
82 | for(<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 | |
86 | CheckGlobalList; |
87 | Smerge -1; |
87 | |
88 | |
88 | SetOption OPT_SAVEPATH, "uudst/"; |
89 | SetOption 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 | } |