[Chicago-talk] broken pipe and dup-ing stdin

Andy_Bach at wiwb.uscourts.gov Andy_Bach at wiwb.uscourts.gov
Mon Nov 15 16:15:27 CST 2004


Hey.

Have a little 'digester' script that takes ufsdump logs and makes them a 
little less wordy.  I just tried adding a stdin option, using a dash and 
due to the funky way I was handling things before, I ended up doing:
my $log_file;
if ( @ARGV and $ARGV[0] eq "-" ) {
 # read stdin
  $log = "stdin";
} else {
  $log = shift || $def_log_file_name;
}
...
  if ( $log ne "stdin" ) {
    open(LOG, "$log_dir/$log" ) or die "can't open log $log: $!";
  } else {
    open(LOG, "-" ) or die "can't open log $log: $!";
  }
  while (<LOG>) {
...

I then saw ("uback -g" just cats the old log file) Broken Pipe errors:
$ uback -g | ufs_status.pl -
set 1: 288.97MB at: 6010 KB/sec - 360.60 MB/min
set 2: 1450.35MB at: 9459 KB/sec - 567.54 MB/min
...
stdin: level 0 of 119056.45MB on 1 volumes
total: 119056MB on 1 volumes
Broken Pipe
Broken Pipe

but not consistently:
$  uback -g | ufs_status.pl -
set 1: 288.97MB at: 6010 KB/sec - 360.60 MB/min
set 2: 1450.35MB at: 9459 KB/sec - 567.54 MB/min
set 3: 768.43MB at: 10716 KB/sec - 642.96 MB/min
...
stdin: level 0 of 119056.45MB on 1 volumes
total: 119056MB on 1 volumes

in fact, I could do about 20 of them and not see a Broken Pipe but ever 
now and then, I'd see one.   Anybody know what the broken pipe criteria 
is?

a

Andy Bach, Sys. Mangler
Internet: andy_bach at wiwb.uscourts.gov 
VOICE: (608) 261-5738  FAX 264-5932

Hacking's just another word for nothing left to kludge


More information about the Chicago-talk mailing list