diff options
| author | fukachan <fukachan> | 2001-06-02 12:38:19 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-06-02 12:38:19 +0000 |
| commit | e3b3709cef453d575e3a59a75a2739ce2a56a094 (patch) | |
| tree | fa51f88bd3a5fe44229e211d9ab2d127b77d57d3 /fml/lib/File | |
| parent | 39d14b15b1a9b6378f3e6b5d5c916b05e5cd350d (diff) | |
| download | fml8-e3b3709cef453d575e3a59a75a2739ce2a56a094.tar.gz fml8-e3b3709cef453d575e3a59a75a2739ce2a56a094.tar.bz2 fml8-e3b3709cef453d575e3a59a75a2739ce2a56a094.zip | |
clean up document
Diffstat (limited to 'fml/lib/File')
| -rw-r--r-- | fml/lib/File/Rotate.pm | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/fml/lib/File/Rotate.pm b/fml/lib/File/Rotate.pm index d44b6646..269f2878 100644 --- a/fml/lib/File/Rotate.pm +++ b/fml/lib/File/Rotate.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: Rotate.pm,v 1.5 2001/04/03 09:31:27 fukachan Exp $ +# $FML: Rotate.pm,v 1.6 2001/05/28 16:17:14 fukachan Exp $ # package File::Rotate; @@ -30,7 +30,9 @@ File::Rotate - file rotatation utilities =head1 DESCRIPTION Utility functions for file rotate operations. -It turns over the given C<file>. +It turns over the given C<file> by some condition. +Typical condition is given as the number of files or how old they are. + C<rotation> renames and rearranges files like this: rm file.4 @@ -40,6 +42,10 @@ C<rotation> renames and rearranges files like this: mv file.0 file.1 mv file file.0 +In old age, shell script does this but +in modern unix, +some programs such as /usr/bin/newsyslog (MIT athena project) do. + =head1 METHODS =head2 C<new($args)> @@ -76,7 +82,15 @@ sub new } -# Descriptions: determine the time to rotate comes +=head2 C<is_time_to_rotate()> + +C<stat()> the file correspoinding to the object and +determine whether the time to do comes or not. + +=cut + + +# Descriptions: determine the time to rotate # Arguments: $self # Side Effects: none # Return Value: 1 (time comes!) or 0 @@ -93,6 +107,18 @@ sub is_time_to_rotate } +=head2 C<rotate()> + +rename files to rotate it. + + rm file.4 + mv file.3 file.4 + mv file.2 file.3 + mv file.1 file.2 + mv file.0 file.1 + mv file file.0 + +=cut # Descriptions: rotate filenames # Arguments: $self @@ -130,6 +156,12 @@ sub _get_param } +=head2 C<error()> + +return the error message if exists. + +=cut + # Descriptions: return error message # Arguments: $self # XXX $self is blessed file handle. |
