diff options
author | Norbert Preining <preining@logic.at> | 2018-05-14 13:01:34 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2018-05-14 13:01:34 +0000 |
commit | 1b10b3c76874d1c40695cfb37be1b062e434618d (patch) | |
tree | a6cdc20aaa3ea150b1c947459ee4e5a8038a5108 | |
parent | 370347ec6ceb8863c4f39eca9d5169e65aa114f0 (diff) |
use copy&remove instead of rename
this should help Windows Users cope with AV programs
git-svn-id: svn://tug.org/texlive/trunk@47711 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index ef36e54aa48..e41aea078e2 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -101,6 +101,7 @@ use TeXLive::TLUtils qw(dirname mkdirhier member win32 info log debug ddebug use TeXLive::TLWinGoo; use Cwd 'abs_path'; +use File::Copy qw//; my $_listdir; @@ -628,9 +629,11 @@ sub save { open(FOO, ">$tmppath") || die "$0: open(>$tmppath) failed: $!"; $self->writeout(\*FOO); close(FOO); + # on Windows the renaming sometimes fails, try to copy and unlink the + # .tmp file. This we do for all archs, cannot hurt. # if we managed that one, we move it over - die ("rename $tmppath to $path failed: $!") - unless rename($tmppath, $path); + File::Copy::copy ($tmppath, $path) or die ("copy $tmppath to $path failed: $!"); + unlink ($tmppath) or tlwarn ("TLPDB: cannot unlink $tmppath: $!\n"); } =pod |