CatalystX::Usul::FileSystem - File system related methods
0.6.$Revision: 1165 $
package CatalystX::Usul::Model::FileSystem; use CatalystX::Usul::FileSystem; 1; package YourApp::Model::FileSystem; use base qw(CatalystX::Usul::Model::FileSystem); 1; package YourApp::Controller::Foo; sub bar { my ($self, $c) = @_; $c->model( q(FileSystem) )->list_subdirectory( { dir => q(/path) } ); return; }
This model provides methods for manipulating files and directories
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
Archives a file by prepending the $self-postfix>, which defaults to A_
$self-
Uses the system fuser command if it is available to determine if a file is in use
fuser
Parses the output from the system mount command to produce a list of file systems
mount
Returns the -rw-rw-r-- style permission string for a given octal mode
-rw-rw-r--
Generates the table data for a directory listing. The data is used by the table subclass of HTML::FormWidgets
Archive old files and delete even older ones from a given directory
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
move
Calls "rotate". Will also touch a new logfile into existence and optionally signal a process
touch
Calls "rotate_log" on all of the .log files in the given directory, which defaults to the logs directory
Reverse out the effect of calling "archive"
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
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <Support at RoxSoft.co.uk>
<Support at RoxSoft.co.uk>
Copyright (c) 2011 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install CatalystX::Usul, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::Usul
CPAN shell
perl -MCPAN -e shell install CatalystX::Usul
For more information on module installation, please visit the detailed CPAN module installation guide.