summaryrefslogtreecommitdiff
path: root/fml/lib/IO/Adapter
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-06-27 05:51:22 +0000
committerfukachan <fukachan>2004-06-27 05:51:22 +0000
commit93dcf39535d34c1715c9d83fa636cf8cb3c44613 (patch)
tree7872416544ab7c79cd8ba3b8969233b00043c4a2 /fml/lib/IO/Adapter
parent8fe2145048ec52fa69c40f64fd6b7f0c199f9269 (diff)
downloadfml8-93dcf39535d34c1715c9d83fa636cf8cb3c44613.tar.gz
fml8-93dcf39535d34c1715c9d83fa636cf8cb3c44613.tar.bz2
fml8-93dcf39535d34c1715c9d83fa636cf8cb3c44613.zip
close() allows 0 byte file e.g. in the case so that all content is
removed.
Diffstat (limited to 'fml/lib/IO/Adapter')
-rw-r--r--fml/lib/IO/Adapter/AtomicFile.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/fml/lib/IO/Adapter/AtomicFile.pm b/fml/lib/IO/Adapter/AtomicFile.pm
index c66edc4e..b2dfeed7 100644
--- a/fml/lib/IO/Adapter/AtomicFile.pm
+++ b/fml/lib/IO/Adapter/AtomicFile.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: AtomicFile.pm,v 1.11 2004/02/15 04:38:36 fukachan Exp $
+# $FML: AtomicFile.pm,v 1.12 2004/05/25 04:03:49 fukachan Exp $
#
package IO::Adapter::AtomicFile;
@@ -197,7 +197,8 @@ sub close
$fh->SUPER::close();
}
- if (-s $temp && rename($temp, $orig)) {
+ # allow 0 bytes. e.g. in the case so that all content is removed.
+ if (rename($temp, $orig)) {
return 1;
}
else {