From d621dcfea1f1213111acf4aa3247a84ff340e313 Mon Sep 17 00:00:00 2001 From: fukachan Date: Sat, 10 Mar 2001 11:11:19 +0000 Subject: update descriptions --- fml/lib/File/RingBuffer.pm | 16 ++++++++-------- fml/lib/File/Utils.pm | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 10 deletions(-) (limited to 'fml/lib/File') diff --git a/fml/lib/File/RingBuffer.pm b/fml/lib/File/RingBuffer.pm index fda996b3..f3a4a1dc 100644 --- a/fml/lib/File/RingBuffer.pm +++ b/fml/lib/File/RingBuffer.pm @@ -45,8 +45,9 @@ If so, the file names become _smtplog.0, _smtplog.1, ... =head1 DESCRIPTION -To log messages but up to some limit, it may be useful to use a file -in cyclic way. It is chosen among a set of files as a buffer. +To log messages but up to some limit, it may be useful to use filenames +in cyclic way. +The file to write is chosen among a set of files allocated as a buffer. Consider several files under a directory C where the unit of the ring is 5 here. @@ -55,16 +56,15 @@ C may have 5 files in it. 0 1 2 3 4 To log a message is to write it to one of them. -At the first time the message is logged to the file C<1>, -and next time to C<2> and so on. -If all 5 files are used, pick up and use (overwrite) the oldest one. -The oldest one is C<0>. +At the first time the message is logged to the file C<0>, +and next time to C<1> and so on. +If all 5 files are used, it reuses and overwrites the oldest one C<0>. -We use a file in cyclic way as follows: +So we use a file in cyclic way as follows: 0 -> 1 -> 2 -> 3 -> 4 -> 0 -> 1 -> ... -We expires the old data. +We expire the old data. A file name is a number for simplicity. The latest number is holded in C file (C<.seq> in that direcotry by default) and truncated to 0 by the modulus C<5>. diff --git a/fml/lib/File/Utils.pm b/fml/lib/File/Utils.pm index 401768aa..b319d86c 100644 --- a/fml/lib/File/Utils.pm +++ b/fml/lib/File/Utils.pm @@ -20,7 +20,7 @@ require Exporter; =head1 NAME -File::Utils - error handling utilities +File::Utils - utilities to handle files =head1 SYNOPSIS @@ -37,7 +37,6 @@ C and C. - =head1 METHODS =cut @@ -55,6 +54,13 @@ sub error { return $ErrorString;} sub error_reset { undef $ErrorString;} +=head2 C + +make a directory C<$dir> by the mode C<$mode> recursively. + +=cut + + # Descriptions: "mkdir -p" or "mkdirhier" # Arguments: directory [file_mode] # Side Effects: set $ErrorString @@ -75,6 +81,12 @@ sub mkdirhier } +=head2 C + +create a file which is size zero if the file not exists. + +=cut + # Descriptions: touch: create file if file not exists # Arguments: file file_mode # Side Effects: none @@ -109,6 +121,18 @@ sub touch } +=head2 C + +search C<$file>. +C<$path_list> is the hash array. +It searches it among C<$path_list> if specified. + +The default search path list is + + ('/usr/bin', '/bin', '/sbin', ' /usr/local/bin', + '/usr/gnu/bin', '/usr/pkg/bin') + +=cut # Descriptions: file $file executable # Arguments: file [path_list] @@ -146,6 +170,12 @@ sub search_program } +=head2 C + +copy C<$src> to C<$dst> in the atomic way. +This routine uses C module. + +=cut # wrappers for delegation :-) sub copy -- cgit v1.2.1