CatalystX::Usul::FileSystem - File system related methods


CatalystX-Usul documentation  | view source Contained in the CatalystX-Usul distribution.

Index


Name

Top

CatalystX::Usul::FileSystem - File system related methods

Version

Top

0.3.$Revision: 576 $

Synopsis

Top

   package CatalystX::Usul::Model::FileSystem;

   use CatalystX::Usul::FileSystem;

   1;

   package MyApp::Model::FileSystem;

   use base qw(CatalystX::Usul::Model::FileSystem);

   1;

   package MyApp::Controller::Foo;

   sub bar {
      my ($self, $c) = @_;

      $c->model( q(FileSystem) )->list_subdirectory( { dir => q(/path) } );
      return;
   }

Description

Top

This model provides methods for manipulating files and directories

Subroutines/Methods

Top

new

Constructor defines logsdir; the location of the applications log files and no_thrash; the length of time to wait between test for the existence of a file to avoid a spin loop

archive

Archives a file by prepending the $self-postfix>, which defaults to A_

file_in_use

Uses the system fuser command if it is available to determine if a file is in use

get_file_systems

Parses the output from the system mount command to produce a list of file systems

get_perms

Returns the -rw-rw-r-- style permission string for a given octal mode

list_subdirectory

Generates the table data for a directory listing. The data is used by the table subclass of HTML::FormWidgets

purge_tree

Archive old files and delete even older ones from a given directory

rotate

Issues a sequence a move commands to rename file to file.0, file.0 to file.1, file.1 to file.2 and so on. Will also touch a new logfile into existence and optionally signal a process

rotate_logs

Calls rotate on all of the .log files in the given directory, which defaults to the logs directory

unarchive

Reverse out the effect of calling archive

wait_for

Wait for a given file to exist. Polls at given intervals file a configurable period before throwing a time out error if the file does not show up

Diagnostics

Top

None

Configuration and Environment

Top

None

Dependencies

Top

CatalystX::Usul
CatalystX::Usul::Table
CatalystX::Usul::Utils

Incompatibilities

Top

There are no known incompatibilities in this module

Bugs and Limitations

Top

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Author

Top

Peter Flanigan, <Support at RoxSoft.co.uk>

License and Copyright

Top


CatalystX-Usul documentation  | view source Contained in the CatalystX-Usul distribution.