retitle 494112 File::Copy::move truncates open file when rename fails
reassign 494112 perl-modules
thanks

On 2008-08-07 14:26:07 +0200, Vincent Lefevre wrote:
> The size of the truncated file appears here. If I understand correctly,
> the failed rename has truncated the configure.tmp file.

It wasn't truncated, but copied without being flushed first.
The problem comes from:

  if ($atomic_replace && !rename("$output.tmp", "$output")) {
    move ("${output}.tmp", "$output")
      or fatal "cannot rename ${output}.tmp as $output: $!";
  }

in /usr/bin/autom4te. File::Copy::move tries to do a "rename" first.
If the system call succeeds, no problem. But if it fails (such as with
sshfs[*]), the file gets truncated.

[*] cache=no doesn't matter, but if "sshfs -o workaround=all" is used,
the rename succeeds and the renamed file is OK.

-- 
Vincent Lefèvre <[EMAIL PROTECTED]> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to