summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-07-25 11:34:01 +0000
committerfukachan <fukachan>2002-07-25 11:34:01 +0000
commitd1e84c03570cc15e54c36855555580961fa2ff45 (patch)
tree3266fb3793273fe3e47344bdbe9ee030891b1c0f
parent14a24dabf3c07eeb58de4c56f43b39a41d792cae (diff)
downloadfml8-d1e84c03570cc15e54c36855555580961fa2ff45.tar.gz
fml8-d1e84c03570cc15e54c36855555580961fa2ff45.tar.bz2
fml8-d1e84c03570cc15e54c36855555580961fa2ff45.zip
rename: IO::File::Atomic -> IO::Adapter::AtomicFile
-rw-r--r--fml/lib/FML/Config.pm6
-rw-r--r--fml/lib/File/Sequence.pm10
-rw-r--r--fml/lib/File/Utils.pm6
-rw-r--r--fml/lib/IO/Adapter/AtomicFile.pm (renamed from fml/lib/IO/File/Atomic.pm)24
-rw-r--r--fml/lib/IO/Adapter/File.pm6
5 files changed, 26 insertions, 26 deletions
diff --git a/fml/lib/FML/Config.pm b/fml/lib/FML/Config.pm
index bc31fb20..277cb375 100644
--- a/fml/lib/FML/Config.pm
+++ b/fml/lib/FML/Config.pm
@@ -3,7 +3,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: Config.pm,v 1.66 2002/07/23 13:25:29 fukachan Exp $
+# $FML: Config.pm,v 1.67 2002/07/23 13:37:47 fukachan Exp $
#
package FML::Config;
@@ -549,10 +549,10 @@ sub write
# 1. check whether I can open $file or not in atomic way.
# XXX get handle to update $file
- my $fh = IO::File::Atomic->open($file);
+ my $fh = IO::Adapter::AtomicFile->open($file);
# 2. back up config.cf firstly
- my $status = IO::File::Atomic->copy($file, $file.".bak");
+ my $status = IO::Adapter::AtomicFile->copy($file, $file.".bak");
unless ($status) {
croak "cannot backup $file";
}
diff --git a/fml/lib/File/Sequence.pm b/fml/lib/File/Sequence.pm
index 47bd1bcd..c96d8426 100644
--- a/fml/lib/File/Sequence.pm
+++ b/fml/lib/File/Sequence.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: Sequence.pm,v 1.23 2002/04/08 12:44:26 fukachan Exp $
+# $FML: Sequence.pm,v 1.24 2002/07/02 12:51:39 fukachan Exp $
#
package File::Sequence;
@@ -124,8 +124,8 @@ sub increment_id
};
};
- use IO::File::Atomic;
- my ($rh, $wh) = IO::File::Atomic->rw_open($seq_file);
+ use IO::Adapter::AtomicFile;
+ my ($rh, $wh) = IO::Adapter::AtomicFile->rw_open($seq_file);
# read the current sequence number
if (defined $rh) {
@@ -189,8 +189,8 @@ sub get_id
return 0;
};
- use IO::File::Atomic;
- my ($rh, $wh) = IO::File::Atomic->rw_open($seq_file);
+ use IO::Adapter::AtomicFile;
+ my ($rh, $wh) = IO::Adapter::AtomicFile->rw_open($seq_file);
# read the current sequence number
if (defined $rh) {
diff --git a/fml/lib/File/Utils.pm b/fml/lib/File/Utils.pm
index 55693dc8..d7bba21b 100644
--- a/fml/lib/File/Utils.pm
+++ b/fml/lib/File/Utils.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: Utils.pm,v 1.13 2002/04/24 03:47:51 fukachan Exp $
+# $FML: Utils.pm,v 1.14 2002/07/02 12:52:10 fukachan Exp $
#
package File::Utils;
@@ -190,7 +190,7 @@ sub search_program
=head2 copy($src, $dst)
copy C<$src> to C<$dst> in atomic way.
-This routine uses C<IO::File::Atomic> module.
+This routine uses C<IO::Adapter::AtomicFile> module.
=cut
@@ -202,7 +202,7 @@ This routine uses C<IO::File::Atomic> module.
sub copy
{
my ($src, $dst) = @_;
- my $pkg = 'IO::File::Atomic';
+ my $pkg = 'IO::Adapter::AtomicFile';
eval qq{ require $pkg; $pkg->import();};
unless ($@) {
diff --git a/fml/lib/IO/File/Atomic.pm b/fml/lib/IO/Adapter/AtomicFile.pm
index 95a81bcb..be803bc5 100644
--- a/fml/lib/IO/File/Atomic.pm
+++ b/fml/lib/IO/Adapter/AtomicFile.pm
@@ -4,10 +4,10 @@
# 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.15 2002/06/01 03:01:55 fukachan Exp $
+# $FML: Atomic.pm,v 1.16 2002/06/01 04:56:42 fukachan Exp $
#
-package IO::File::Atomic;
+package IO::Adapter::AtomicFile;
use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK);
use Carp;
@@ -19,12 +19,12 @@ END {}
=head1 NAME
-IO::File::Atomic - atomic IO operation
+IO::Adapter::AtomicFile - atomic IO operation
=head1 SYNOPSIS
- use IO::File::Atomic;
- my $wh = IO::File::Atomic->open($file);
+ use IO::Adapter::AtomicFile;
+ my $wh = IO::Adapter::AtomicFile->open($file);
if (defined $wh) {
print $wh "new/updated things ...";
$wh->close unless $wh->error;
@@ -36,13 +36,13 @@ Updating is defered until C<close()>.
In usual cases, you use this module in the following way.
use FileHandle;
- use IO::File::Atomic;
+ use IO::Adapter::AtomicFile;
# get read handle for $file
my $rh = new FileHandle $file;
# get handle to update $file
- my $wh = IO::File::Atomic->open($file);
+ my $wh = IO::Adapter::AtomicFile->open($file);
if (defined $rh && defined $wh) {
while (<$rh>) {
print $wh "new/updated things ...";
@@ -53,8 +53,8 @@ In usual cases, you use this module in the following way.
You can use this method to open $file for both read and write.
- use IO::File::Atomic;
- my ($rh, $wh) = IO::File::Atomic->rw_open($file);
+ use IO::Adapter::AtomicFile;
+ my ($rh, $wh) = IO::Adapter::AtomicFile->rw_open($file);
if (defined $rh && defined $wh) {
while (<$rh>) {
print $wh "new/updated things ...";
@@ -65,7 +65,7 @@ You can use this method to open $file for both read and write.
To copy from $src to $dst,
- IO::File::Atomic->copy($src, $dst) || croak("fail to copy");
+ IO::Adapter::AtomicFile->copy($src, $dst) || croak("fail to copy");
=head1 DESCRIPTION
@@ -205,7 +205,7 @@ sub close
=head2 copy(src, dst)
copy from C<src> file to C<dst> file in atomic way by using
-C<IO::File::Atomic::rw_open>.
+C<IO::Adapter::AtomicFile::rw_open>.
=cut
@@ -301,7 +301,7 @@ redistribute it and/or modify it under the same terms as Perl itself.
=head1 HISTORY
-IO::File::Atomic appeared in fml5 mailing list driver package.
+IO::Adapter::AtomicFile appeared in fml5 mailing list driver package.
See C<http://www.fml.org/> for more details.
=cut
diff --git a/fml/lib/IO/Adapter/File.pm b/fml/lib/IO/Adapter/File.pm
index 7d8b6b55..54fd3d84 100644
--- a/fml/lib/IO/Adapter/File.pm
+++ b/fml/lib/IO/Adapter/File.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: File.pm,v 1.34 2002/07/24 11:05:50 fukachan Exp $
+# $FML: File.pm,v 1.35 2002/07/25 00:11:23 fukachan Exp $
#
package IO::Adapter::File;
@@ -130,8 +130,8 @@ sub _rw_open
my $file = $args->{ file };
my $flag = $args->{ flag };
- require IO::File::Atomic;
- my ($rh, $wh) = IO::File::Atomic->rw_open($file);
+ use IO::Adapter::AtomicFile;
+ my ($rh, $wh) = IO::Adapter::AtomicFile->rw_open($file);
$self->{ _fh } = $rh;
$self->{ _wh } = $wh;
$rh;