CatalystX::Usul::File - File and directory IO base class
0.5.$Revision: 1139 $
package MyBaseClass; use base qw(CatalystX::Usul::File);
Provides file and directory methods to the application base class
$absolute_path = $self->_abs_path( $base, $path );
Prepends $base to $path unless $path is an absolute path
$basename = $self->basename( $path, @suffixes );
Returns the base name of the passed path
$dir_path = $self->catdir( $part1, $part2 );
Expose "catdir" in File::Spec
$file_path = $self->catfile( $dir_path, $file_name );
Expose "catfile" in File::Spec
$dir_path = $self->classdir( __PACKAGE__ );
Returns the path (directory) of a given class. Like "classfile" but without the .pm extenstion
$file_path = $self->classfile( __PACKAGE__ );
Returns the path (file name plus extension) of a given class. Uses File::Spec for portability, e.g. App::Munchies becomes App/Munchies.pm
App::Munchies
App/Munchies.pm
$self->delete_tmp_files( $dir );
Delete this processes temporary files. Files are in the $dir directory which defaults to $self->tempdir
$dir
$self->tempdir
$dirname = $self->dirname( $path );
Returns the directory name of the passed path
$f_dc_schema_obj = $self->file_dataclass_schema( $attrs );
Returns a File::DataClass::Schema object. Object uses our exception_class, no caching and no locking
exception_class
$path = $self->find_source( $module_name );
Find the source code for the given module
$io_obj = $self->io( $pathname );
Expose the methods in File::DataClass::IO
$stat_ref = $self->status_for( $path );
Return a hash for the given path containing it's inode status information
$out_ref = $self->symlink( $base, $from, $to );
Creates a symlink. If either $from or $to is a relative path then $base is prepended to make it absolute. Returns a message indicating success or throws an exception on failure
$from
$to
$base
$tempfile_obj = $self->tempfile( $dir );
Returns a File::Temp object in the $dir directory which defaults to $self->tempdir. File is automatically deleted if the $tempfile_obj reference goes out of scope
$tempfile_obj
$pathname = $self->tempname( $dir );
Returns the pathname of a temporary file in the given directory which defaults to $self->tempdir. The file will be deleted by "delete_tmp_files" if it is called otherwise it will persist
$uuid = $self->uuid;
Return the contents of /proc/sys/kernel/random/uuid
None
The /uuid method with only work on a OS with a /proc filesystem
/uuid
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.