From 13f00299526653d35c7787bb46aaf11e8eae3b73 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 7 Oct 2009 16:31:47 +0000 Subject: (substInFile) call fsync() when editing a non empty file --- lib/MDK/Common/File.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/MDK') diff --git a/lib/MDK/Common/File.pm b/lib/MDK/Common/File.pm index 71fe71c..cdcfcd9 100644 --- a/lib/MDK/Common/File.pm +++ b/lib/MDK/Common/File.pm @@ -289,6 +289,8 @@ sub substInFile(&@) { &$f($_); print; } + open(my $F, $file); + fsync($F); unlink "$file$^I"; # remove old backup now that we'have closed new file } else { local *F; my $old = select F; # that way eof return true -- cgit v1.2.1