summaryrefslogtreecommitdiff
path: root/fml
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-08-21 14:27:21 +0000
committerfukachan <fukachan>2002-08-21 14:27:21 +0000
commit1bb4d49c04b857ab4afd87c162c56db94dd36756 (patch)
treef61fb31f509df9283dfeb553f42aa219f2a936e5 /fml
parent2c1dd968f3e38412aa551cfb9fe10f09d8907097 (diff)
downloadfml8-1bb4d49c04b857ab4afd87c162c56db94dd36756.tar.gz
fml8-1bb4d49c04b857ab4afd87c162c56db94dd36756.tar.bz2
fml8-1bb4d49c04b857ab4afd87c162c56db94dd36756.zip
more unique temp filename
Diffstat (limited to 'fml')
-rw-r--r--fml/lib/IO/Adapter/AtomicFile.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/fml/lib/IO/Adapter/AtomicFile.pm b/fml/lib/IO/Adapter/AtomicFile.pm
index be803bc5..539847e2 100644
--- a/fml/lib/IO/Adapter/AtomicFile.pm
+++ b/fml/lib/IO/Adapter/AtomicFile.pm
@@ -4,12 +4,12 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Atomic.pm,v 1.16 2002/06/01 04:56:42 fukachan Exp $
+# $FML: AtomicFile.pm,v 1.1 2002/07/25 11:34:02 fukachan Exp $
#
package IO::Adapter::AtomicFile;
use strict;
-use vars qw(@ISA @EXPORT @EXPORT_OK);
+use vars qw(@ISA @EXPORT @EXPORT_OK $Counter);
use Carp;
use IO::File;
@ISA = qw(IO::File);
@@ -132,7 +132,9 @@ sub open
$mode ||= "w";
# temporary file
- my $temp = $file.".new.".$$;
+ unless (defined $Counter) { $Counter = 0;}
+ $Counter++;
+ my $temp = $file.".new.".$$.$Counter;
${*$self}{ _orig_file } = $file;
${*$self}{ _temp_file } = $temp;