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.12 by root, Sat May 26 15:15:50 2007 UTC vs.
Revision 1.14 by root, Fri Oct 10 20:23:12 2008 UTC

40# the following non-trivial FileNameCallback takes care 40# the following non-trivial FileNameCallback takes care
41# of some subject lines not detected properly by uulib: 41# of some subject lines not detected properly by uulib:
42SetFileNameCallback sub { 42SetFileNameCallback sub {
43 return unless $_[1]; # skip "Re:"-plies et al. 43 return unless $_[1]; # skip "Re:"-plies et al.
44 local $_ = $_[0]; 44 local $_ = $_[0];
45
46 return $1 if /(\S+\s+IMG_\d+.jpg)/i;
45 47
46 # the following rules are rather effective on some newsgroups, 48 # the following rules are rather effective on some newsgroups,
47 # like alt.binaries.games.anime, where non-mime, uuencoded data 49 # like alt.binaries.games.anime, where non-mime, uuencoded data
48 # is very common 50 # is very common
49 51
96 print "$k > $v, "; 98 print "$k > $v, ";
97 } 99 }
98 print "\n"; 100 print "\n";
99 } 101 }
100 102
101 $uu->decode_temp; 103 print $uu->filename;
104 if (my $err = $uu->decode_temp) {
105 print " ", strerror $err, "\n";
106 } else {
102 print " temporarily decoded to ", $uu->binfile, "\n"; 107 print " temporarily decoded to ", $uu->binfile;
103 $uu->remove_temp; 108 $uu->remove_temp;
104 109
105 print strerror $uu->decode; 110 if (my $err = $uu->decode ()) {
111 print ", ", strerror $err, "\n";
112 } else {
106 print " saved as uudst/", $uu->filename, "\n"; 113 print ", saved as uudst/", $uu->filename, "\n";
114 }
115 }
107} 116}
108 117
109print "cleanup...\n"; 118print "cleanup...\n";
110 119
111CleanUp(); 120CleanUp();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines