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.1 by root, Mon Jun 11 19:48:55 2001 UTC vs.
Revision 1.5 by root, Fri Apr 5 21:56:57 2002 UTC

29SetMsgCallback (sub { 29SetMsgCallback (sub {
30 my($msg,$level)=@_; 30 my($msg,$level)=@_;
31 print uc(strmsglevel($_[1])),": $msg\n"; 31 print uc(strmsglevel($_[1])),": $msg\n";
32}); 32});
33 33
34SetFileNameCallback sub {
35 return unless $_[1]; # skip "Re:"-plies et al.
36 local $_ = $_[0];
37
38 # the following rules are rather effective on some newsgroups,
39 # like alt.binaries.games.anime, where non-mime, uuencoded data
40 # is very common
41
42 # if we find some *.rar, take it
43 return $1 if /(\S+\.(?:[rstuvwxyz]\d\d|rar))\s/i;
44
45 # - filename.par (04/55)
46 return $1 if /- "?(\S+\.\S+?)"? (:yenc )?\(\d+\/\d+\)/i;
47
48 # otherwise just pass what we have
49 return ();
50};
51
52
34for(<uusrc/*>) { 53for(<uusrc/*>) {
35 my($retval,$count)=LoadFile ($_,$_,1); 54 my($retval,$count)=LoadFile ($_,$_,1);
36 print "file($_), status(",strerror($retval),") parts($count)\n"; 55 print "file($_), status(",strerror($retval),") parts($count)\n";
37} 56}
38 57
58 print "$k > $v, "; 77 print "$k > $v, ";
59 } 78 }
60 print "\n"; 79 print "\n";
61 } 80 }
62 81
63 $uu->decode_temp; 82 print strerror($uu->decode_temp)."\n";
64 print " temporarily decoded to ",$uu->binfile,"\n"; 83 print " temporarily decoded to ",$uu->binfile,"\n";
65 $uu->remove_temp; 84 $uu->remove_temp;
66 85
67 print strerror($uu->decode); 86 print strerror($uu->decode)."\n";
68 print " saved as uudst/",$uu->filename,"\n"; 87 print " saved as uudst/",$uu->filename,"\n";
69} 88}
70 89
71print "cleanup...\n"; 90print "cleanup...\n";
72 91

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines