push @table, $info;
}
- else
- {
- print STDERR "Removing stale file: $file\n";
- unlink $file;
- }
}
if ( $options->{ 'sort' } =~ /^(USER|TMP_DIR|START_TIME|RUN_TIME|COMMAND)$/ ) {
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;