#!/home/jc0/aix/bin/perl # # nullfile [opts] [file]... # nullfile [opts] ) { for $f (split(/\s+/,$l)) { if ($f) { &checkfile($f); } } } } exit $stat; sub checkfile { local($f) = @_; ++$files; if (open(F,"<$f")) { if ($n = read(F,$x,$cnt)) { $x =~ s/\0//g; if (!$x) { print "Bad file \"$f\" (first $cnt bytes are null)\n" if $cfl; ++$stat; } } elsif ($n < 0) { print "Can't read \"$f\" [$!]\n" if $pfl; } else { print "Empty file \"$f\"\n" if $efl; } } else { print "Can't open \"$f\" [$!]\n" if $pfl; } }