Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 64147
Status: resolved
Priority: 0/
Queue: libwww-perl

Owner: Nobody in particular
Requestors: SREZIC [...]

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)


Subject: [PATCH] mirror: set modification time in an atomic way
Download (untitled) / with headers
text/plain 140b
mirror() should set the modification time of the mirrored file *before* the temporary file is renamed. Patch attached. Regards, Slaven
Subject: 0002-mirror-set-the-modification-time-before-renaming-the.patch
From efda27ea996de3f039b6f85e6022512633048831 Mon Sep 17 00:00:00 2001 From: Slaven Rezic <> Date: Wed, 22 Dec 2010 16:50:45 +0100 Subject: [PATCH 2/2] mirror: set the modification time *before* renaming the temporary file --- lib/LWP/ | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/LWP/ b/lib/LWP/ index fe93fe1..4303d13 100644 --- a/lib/LWP/ +++ b/lib/LWP/ @@ -868,13 +868,14 @@ sub mirror chmod 0777, $file; unlink $file; } - rename( $tmpfile, $file ) - or die "Cannot rename '$tmpfile' to '$file': $!\n"; # make sure the file has the same last modification time if ( my $lm = $response->last_modified ) { - utime $lm, $lm, $file; + utime $lm, $lm, $tmpfile; } + + rename( $tmpfile, $file ) + or die "Cannot rename '$tmpfile' to '$file': $!\n"; } } # The local copy is fresh enough, so just delete the temp file --

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to