]> dxcluster.org Git - spider.git/commitdiff
add comments about race condx
authorminima <minima>
Thu, 7 Oct 2004 13:38:52 +0000 (13:38 +0000)
committerminima <minima>
Thu, 7 Oct 2004 13:38:52 +0000 (13:38 +0000)
perl/importwwv.pl

index bca63688e28751f68dd1817f42524787f8bd126d..2a86e0dee74164210f3db4a538c1cde8ec2fda40 100755 (executable)
@@ -101,6 +101,10 @@ sub out
        open OUT, ">$tmp/$fn" or die "import $tmp/$fn $!";
        print OUT map { "$_\n" } @_;
        close OUT;
+
+       # Note we do this this way to make the appearance of
+       # the file in /spider/chat_import atomic. Otherwise there
+       # exists the possiblity of race conditions and other nasties
        link "$tmp/$fn", "$import/$fn";
        unlink "$tmp/$fn";
 }