--- fuse-comp.pl 2007/07/09 16:20:07 20 +++ fuse-comp.pl 2007/07/09 17:35:26 21 @@ -162,12 +162,17 @@ file_copy( '<:gzip', $path, '>', $tmp ); $path = $tmp; } - warn "<<< open abs path: $path [", -e $path ? -s $path : 'new' , "]\n"; - return -$! unless sysopen($fh , $path, $mode); - close($fh); - $pending->{$file}->{path} = $path; - return 0; + if ( sysopen($fh , $path, $mode) ) { + close($fh) || confess "can't close $path: $!"; + warn "<<< open $path [", -e $path ? -s $path : 'new' , "]\n"; + $pending->{$file}->{path} = $path; + return 0; + } else { + warn "ERROR: can't open $path : $!"; + return -$!; + } + } sub x_read { @@ -274,7 +279,7 @@ $no_gz =~ s/\.gz$//; rename $path, $no_gz || confess "can't rename $path -> $no_gz: $!"; } - warn "## truncate( $file $size ) $path [", -s $path, "]\n"; + warn "## truncate( $file $size ) $path [", -s $path, "] = $rv\n" if $debug; $pending->{$file}->{write}++; return $rv; }