From dc40f820d934bae59e7c59419807a6ea5765bddb Mon Sep 17 00:00:00 2001 From: Marcin Kasperski Date: Thu, 15 Nov 2012 09:25:59 +0100 Subject: [PATCH] Patching previous path (File::Copy::move is even more suitable for the task, than cp+unlink, works efficiently if temp is on the same drive and reverts to cp+unlink otherwise). --- lib/Crypt/PWSafe3.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Crypt/PWSafe3.pm b/lib/Crypt/PWSafe3.pm index 8edee12..36612dd 100644 --- a/lib/Crypt/PWSafe3.pm +++ b/lib/Crypt/PWSafe3.pm @@ -15,7 +15,7 @@ use Digest::HMAC; use Digest::SHA; use Crypt::Random qw( makerandom ); use Data::UUID; -use File::Copy qw(cp); +use File::Copy qw(copy move); use File::Spec; use FileHandle; use Data::Dumper; @@ -375,8 +375,7 @@ sub save { } else { # well, seems to be ok :) - cp($tmpfile, $file); - unlink $tmpfile; + move($tmpfile, $file); } }