X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fbiostat;h=c0b7c13971ba1c938dcc11650918954dd8a5eef5;hb=2a8f4b16e21e5e0b2d268775b035c5f0651e888d;hp=6a7d0406bc0fd1c7d5ceb3138e15068e1633b0d2;hpb=9bf550c4335d8860c5f6f9c4db0f385f1b36c1dd;p=biopieces.git diff --git a/bp_bin/biostat b/bp_bin/biostat index 6a7d040..c0b7c13 100755 --- a/bp_bin/biostat +++ b/bp_bin/biostat @@ -76,11 +76,6 @@ while ( 1 ) push @table, $info; } - else - { - print STDERR "Removing stale file: $file\n"; - unlink $file; - } } if ( $options->{ 'sort' } =~ /^(USER|TMP_DIR|START_TIME|RUN_TIME|COMMAND)$/ ) { @@ -168,9 +163,13 @@ sub get_status_info my ( $fh, $line, $time, $args, $tmp_dir, $du ); - $fh = Maasha::Filesys::file_read_open( $file ); - $line = <$fh>; - close $fh; + if (-e $file) + { + $fh = Maasha::Filesys::file_read_open( $file ); + flock($fh, 1); + $line = <$fh>; + close $fh; + } chomp $line;