NAME
    FML::File::Rotate - file rotatation utilities.

SYNOPSIS
        my $log = new FML::File::Rotate $curproc;
        if ($log->is_time_to_rotate($file)) {
            $log->rotate($file);
        }

DESCRIPTION
    This module provides utility functions for file rotatation. It turns
    over the given files under some condition. Typical condition is given as
    the number of files, size or how old they are.

    "rotation" renames and rearranges files like this:

        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

    In old age, a shell script does this but in modern unix, some programs
    such as /usr/bin/newsyslog (MIT athena project) do it. See newsyslog(8)
    for more details.

METHODS
  new($curproc)
    constructor.

PARAMETERS
  set_size_limit($size)
    set the maximum size limit.

    When the size of the log file reaches this limit, the log file will be
    turned over.

  get_size_limit()
    get the maximum size limit.

  set_archive_file_total($num)
    set the number of archive log files to be kept besides the log file
    itself.

  get_archive_file_total()
    get the number of archive log files to be kept besides the log file
    itself.

  is_time_to_rotate()
    "stat()" the file correspoinding to the object and determine whether the
    time to rotate comes or not.

  rotate($file)
    rename files to rotate.

        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

CODING STYLE
    See "http://www.fml.org/software/FNF/" on fml coding style guide.

SEE ALSO
    newsyslog(8).

AUTHOR
    Ken'ichi Fukamachi

COPYRIGHT
    Copyright (C) 2004,2005,2006 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.

HISTORY
    FML::File::Rotate first appeared in fml8 mailing list driver package.
    See "http://www.fml.org/" for more details.

    FML::File::Rotate (2001-2003) is renamed from File::Rotate class in
    2004.

