chiark / gitweb /
Use .tmp for temporary files and write-then-rename
[ypp-sc-tools.db-test.git] / pctb / commod-results-processor
index cea64e5190318e437c5ad55ff6368cfe0f8a68ed..3ea53be79f49b73a36b9be2f592a307a05b2833e 100755 (executable)
@@ -244,7 +244,7 @@ sub refresh_commodmap() {
     my $incommodmap=0;
     my $intag='';
     my %got;
-    my $o= new IO::File "#commodmap#.tsv.new",'w' or die $!;
+    my $o= new IO::File "#commodmap#.tsv.tmp",'w' or die $!;
     undef %commodmap;
 
     my $xp= new XML::Parser
@@ -292,7 +292,7 @@ sub refresh_commodmap() {
 #    print STDERR "[[[$content]]]\n";
     $xp->parse($content);
     close $o or die $!;
-    rename "#commodmap#.tsv.new","#commodmap#.tsv" or die $!;
+    rename "#commodmap#.tsv.tmp","#commodmap#.tsv" or die $!;
 }
 
 our %newcommods;