$file = "$ENV{ 'BP_TMP' }/" . join( ".", $user, $script, $pid ) . ".status";
$fh = Maasha::Filesys::file_write_open( $file );
+ flock($fh, 2);
print $fh join( ";", $time_stamp, join( " ", @ARGV ) ) . "\n";
return if not -f $file;
$fh = Maasha::Filesys::file_read_open( $file );
+ flock($fh, 1);
$line = <$fh>;
chomp $line;
close $fh;
$elap = Maasha::Common::time_stamp_diff( $time0, $time1 );
$fh_global = Maasha::Filesys::file_append_open( "$ENV{ 'BP_LOG' }/biopieces.log" );
+ flock($fh_global, 2);
$fh_local = Maasha::Filesys::file_append_open( "$ENV{ 'HOME' }/.biopieces.log" );
+ flock($fh_local, 2);
print $fh_global join( "\t", $time0, $time1, $elap, $user, $status, "$script $args" ) . "\n";
print $fh_local join( "\t", $time0, $time1, $elap, $user, $status, "$script $args" ) . "\n";
$script = Maasha::Common::get_scriptname();
$fh = Maasha::Filesys::file_append_open( "$ENV{ 'BP_LOG' }/biopieces.log" );
+ flock($fh, 2);
print $fh "$time_stamp\t$user\t$script ", join( " ", @ARGV ), "\n";
$file = "$ENV{ 'BP_TMP' }/" . join( ".", $user, $script, $pid ) . ".status";
$fh = Maasha::Filesys::file_read_open( $file );
+ flock($fh, 1);
$line = <$fh>;
chomp $line;
close $fh;
$fh = Maasha::Filesys::file_write_open( $file );
+ flock($fh, 2);
print $fh "$line;$path\n";
close $fh;
return undef if not -f $file;
$fh = Maasha::Filesys::file_read_open( $file );
+ flock($fh, 1);
$record = get_record( $fh );
close $fh;