1 | NAME |
1 | NAME |
2 | Convert::UUlib - Perl interface to the uulib library (a.k.a. |
2 | Convert::UUlib - decode uu/xx/b64/mime/yenc/etc-encoded data from a |
3 | uudeview/uuenview). |
3 | massive number of files |
4 | |
4 | |
5 | SYNOPSIS |
5 | SYNOPSIS |
6 | use Convert::UUlib ':all'; |
6 | use Convert::UUlib ':all'; |
7 | |
7 | |
8 | # read all the files named on the commandline and decode them |
8 | # read all the files named on the commandline and decode them |
… | |
… | |
15 | print $uu->filename, "\n"; |
15 | print $uu->filename, "\n"; |
16 | } |
16 | } |
17 | } |
17 | } |
18 | |
18 | |
19 | DESCRIPTION |
19 | DESCRIPTION |
|
|
20 | This module started as an interface to the uulib/uudeview library by |
|
|
21 | Frank Pilhofer that can be used to decode all kinds of usenet (and |
|
|
22 | other) binary messages. |
|
|
23 | |
|
|
24 | After upstream abondoned the project, th library was continuously |
|
|
25 | bugfixed and improved in this module, with major focuses on security |
|
|
26 | fixes, correctness and speed (that does not mean that this library is |
|
|
27 | considered safe with untrusted data, but it surely is safer than the |
|
|
28 | poriginal uudeview). |
|
|
29 | |
20 | Read the file doc/library.pdf from the distribution for in-depth |
30 | Read the file doc/library.pdf from the distribution for in-depth |
21 | information about the C-library used in this interface, and the rest of |
31 | information about the C-library used in this interface, and the rest of |
22 | this document and especially the non-trivial decoder program at the end. |
32 | this document and especially the non-trivial decoder program at the end. |
23 | |
33 | |
24 | EXPORTED CONSTANTS |
34 | EXPORTED CONSTANTS |
… | |
… | |
161 | This function has to walk the linear list of fils on each access, so |
171 | This function has to walk the linear list of fils on each access, so |
162 | if you want to iterate over all items, it is usually faster to use |
172 | if you want to iterate over all items, it is usually faster to use |
163 | "GetFileList". |
173 | "GetFileList". |
164 | |
174 | |
165 | @items = GetFileList |
175 | @items = GetFileList |
166 | Similar to "GetFileListItem", but returns all files in one go. |
176 | Similar to "GetFileListItem", but returns all files in one go, which |
|
|
177 | is very much faster for large number of items, and has no drawbacks |
|
|
178 | when used for a small number of items. |
167 | |
179 | |
168 | Decoding files |
180 | Decoding files |
169 | $retval = $item->rename ($newname) |
181 | $retval = $item->rename ($newname) |
170 | Change the ondisk filename where the decoded file will be saved. |
182 | Change the ondisk filename where the decoded file will be saved. |
171 | |
183 | |
… | |
… | |
304 | SetOption OPT_RBUF, 128*1024; |
316 | SetOption OPT_RBUF, 128*1024; |
305 | SetOption OPT_WBUF, 1024*1024; |
317 | SetOption OPT_WBUF, 1024*1024; |
306 | SetOption OPT_IGNMODE, 1; |
318 | SetOption OPT_IGNMODE, 1; |
307 | SetOption OPT_IGNMODE, 1; |
319 | SetOption OPT_IGNMODE, 1; |
308 | SetOption OPT_VERBOSE, 1; |
320 | SetOption OPT_VERBOSE, 1; |
|
|
321 | SetOption OPT_AUTOCHK, 0; |
309 | |
322 | |
310 | # show the three ways you can set callback functions. I normally |
323 | # show the three ways you can set callback functions. I normally |
311 | # prefer the one with the sub inplace. |
324 | # prefer the one with the sub inplace. |
312 | SetFNameFilter \&namefilter; |
325 | SetFNameFilter \&namefilter; |
313 | |
326 | |
… | |
… | |
351 | # now read all files in the directory uusrc/* |
364 | # now read all files in the directory uusrc/* |
352 | for (<uusrc/*>) { |
365 | for (<uusrc/*>) { |
353 | my ($retval, $count) = LoadFile ($_, $_, 1); |
366 | my ($retval, $count) = LoadFile ($_, $_, 1); |
354 | print "file($_), status(", strerror $retval, ") parts($count)\n"; |
367 | print "file($_), status(", strerror $retval, ") parts($count)\n"; |
355 | } |
368 | } |
|
|
369 | |
|
|
370 | Smerge -1; |
356 | |
371 | |
357 | SetOption OPT_SAVEPATH, "uudst/"; |
372 | SetOption OPT_SAVEPATH, "uudst/"; |
358 | |
373 | |
359 | # now wade through all files and their source parts |
374 | # now wade through all files and their source parts |
360 | for my $uu (GetFileList) { |
375 | for my $uu (GetFileList) { |