diff options
| author | fukachan <fukachan> | 2002-01-13 05:57:40 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-01-13 05:57:40 +0000 |
| commit | a86c9d7defdec55c0079cd01a97d9a21563b8f2a (patch) | |
| tree | 363c1e8b8e802a52f7f8832d7a0183452cb9384d /fml/lib/File | |
| parent | 54556e99fdde4b6744c7925444afb18649dbd7ef (diff) | |
| download | fml8-a86c9d7defdec55c0079cd01a97d9a21563b8f2a.tar.gz fml8-a86c9d7defdec55c0079cd01a97d9a21563b8f2a.tar.bz2 fml8-a86c9d7defdec55c0079cd01a97d9a21563b8f2a.zip | |
clean up comments, update copyright
Diffstat (limited to 'fml/lib/File')
| -rw-r--r-- | fml/lib/File/CacheDir.pm | 4 | ||||
| -rw-r--r-- | fml/lib/File/Rotate.pm | 25 | ||||
| -rw-r--r-- | fml/lib/File/Sequence.pm | 18 | ||||
| -rw-r--r-- | fml/lib/File/SimpleLock.pm | 24 |
4 files changed, 47 insertions, 24 deletions
diff --git a/fml/lib/File/CacheDir.pm b/fml/lib/File/CacheDir.pm index c1d7d546..5a228e9f 100644 --- a/fml/lib/File/CacheDir.pm +++ b/fml/lib/File/CacheDir.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2001 Ken'ichi Fukamachi +# Copyright (C) 2001,2002 Ken'ichi Fukamachi # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: CacheDir.pm,v 1.9 2001/12/22 09:21:11 fukachan Exp $ +# $FML: CacheDir.pm,v 1.10 2002/01/13 05:46:25 fukachan Exp $ # package File::CacheDir; diff --git a/fml/lib/File/Rotate.pm b/fml/lib/File/Rotate.pm index 71782f37..2d50f733 100644 --- a/fml/lib/File/Rotate.pm +++ b/fml/lib/File/Rotate.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2001 Ken'ichi Fukamachi +# Copyright (C) 2001,2002 Ken'ichi Fukamachi # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Rotate.pm,v 1.7 2001/06/02 12:38:20 fukachan Exp $ +# $FML: Rotate.pm,v 1.8 2001/12/22 09:21:11 fukachan Exp $ # package File::Rotate; @@ -48,7 +48,7 @@ some programs such as /usr/bin/newsyslog (MIT athena project) do. =head1 METHODS -=head2 C<new($args)> +=head2 new($args) ordinary constructor. $args accpets the following parameters. @@ -62,10 +62,9 @@ ordinary constructor. $args accpets the following parameters. # Descriptions: constructor # forward new() request to superclass (IO::File) -# Arguments: $class_name $HASH_REFERENCE +# Arguments: OBJ($self) HASH_REF($args) # Side Effects: none -# Return Value: class object -# XXX $self is blessed file handle. +# Return Value: OBJ sub new { my ($self, $args) = shift; @@ -91,7 +90,7 @@ determine whether the time to do comes or not. # Descriptions: determine the time to rotate -# Arguments: $self +# Arguments: OBJ($self) # Side Effects: none # Return Value: 1 (time comes!) or 0 sub is_time_to_rotate @@ -120,8 +119,9 @@ rename files to rotate it. =cut + # Descriptions: rotate filenames -# Arguments: $self +# Arguments: OBJ($self) # Side Effects: filename rotations # unlink the oldest file # Return Value: none @@ -146,9 +146,9 @@ sub rotate # Descriptions: extract parameters in $self -# Arguments: $self +# Arguments: OBJ($self) # Side Effects: none -# Return Value: a set of (file, max_size, num_backlog) +# Return Value: ARRAY(file, max_size, num_backlog) sub _get_param { my ($self) = @_; @@ -162,11 +162,12 @@ return the error message if exists. =cut + # Descriptions: return error message -# Arguments: $self +# Arguments: OBJ($self) # XXX $self is blessed file handle. # Side Effects: none -# Return Value: error message string +# Return Value: STR(error message) sub error { my ($self) = @_; diff --git a/fml/lib/File/Sequence.pm b/fml/lib/File/Sequence.pm index dacabe20..d50fa827 100644 --- a/fml/lib/File/Sequence.pm +++ b/fml/lib/File/Sequence.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2001 Ken'ichi Fukamachi +# Copyright (C) 2001,2002 Ken'ichi Fukamachi # 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.12 2001/11/27 15:55:23 fukachan Exp $ +# $FML: Sequence.pm,v 1.13 2001/12/22 09:21:11 fukachan Exp $ # package File::Sequence; @@ -80,7 +80,7 @@ get the sequence number from specified C<$file>. # Descriptions: constructor # Arguments: OBJ($self) HASH_REF($args) # Side Effects: object itself holds a few local _variables -# Return Value: object +# Return Value: OBJ sub new { my ($self, $args) = @_; @@ -97,7 +97,7 @@ sub new # If $file is not specified, # the sequence_file parameter in new(). # Side Effects: the number holded in $file is incremented -# Return Value: number (sequence number) +# Return Value: NUM(sequence number) sub increment_id { my ($self, $file) = @_; @@ -111,8 +111,10 @@ sub increment_id # touch the sequence file if it does not exist. unless (-f $seq_file) { - use File::Utils qw(touch); - touch($seq_file); + eval q{ + use File::Utils qw(touch); + touch($seq_file); + }; }; use IO::File::Atomic; @@ -152,7 +154,7 @@ sub increment_id # If $file is not specified, # the sequence_file parameter in new(). # Side Effects: the number holded in $file is incremented -# Return Value: number (sequence number) +# Return Value: NUM(sequence number) sub get_id { my ($self, $file) = @_; @@ -198,7 +200,7 @@ To search max_id in hash key, # Descriptions: search max id number # Arguments: OBJ($self) HASH_REF($args) # Side Effects: none -# Return Value: number +# Return Value: NUM sub search_max_id { my ($self, $args) = @_; diff --git a/fml/lib/File/SimpleLock.pm b/fml/lib/File/SimpleLock.pm index 8ae51875..c9bac8ef 100644 --- a/fml/lib/File/SimpleLock.pm +++ b/fml/lib/File/SimpleLock.pm @@ -1,8 +1,8 @@ #-*- perl -*- # -# Copyright (C) 2000,2001 Ken'ichi Fukamachi +# Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi # -# $FML: SimpleLock.pm,v 1.8 2001/05/28 16:17:14 fukachan Exp $ +# $FML: SimpleLock.pm,v 1.9 2001/12/22 09:21:11 fukachan Exp $ # package File::SimpleLock; @@ -51,6 +51,10 @@ sub LOCK_NB {4;} sub LOCK_UN {8;} +# Descriptions: standard constructor. +# Arguments: OBJ($self) HASH_REF($args) +# Side Effects: none +# Return Value: OBJ sub new { my ($self) = @_; @@ -60,6 +64,10 @@ sub new } +# Descriptions: lock +# Arguments: OBJ($self) HASH_REF($args) +# Side Effects: none +# Return Value: 1 or 0 sub lock { my ($self, $args) = @_; @@ -69,6 +77,10 @@ sub lock } +# Descriptions: unlock +# Arguments: OBJ($self) HASH_REF($args) +# Side Effects: none +# Return Value: 1 or 0 sub unlock { my ($self, $args) = @_; @@ -79,6 +91,10 @@ sub unlock +# Descriptions: try flock(2) for $file +# Arguments: OBJ($self) STR($file) +# Side Effects: flock for $file +# Return Value: 1 or 0 sub _simple_flock { my ($self, $file) = @_; @@ -108,6 +124,10 @@ sub _simple_flock } +# Descriptions: try unlock by flock(2) for $file +# Arguments: OBJ($self) STR($file) +# Side Effects: flock for $file +# Return Value: 1 or 0 sub _simple_funlock { my ($self, $file) = @_; |
