Class::Usul::File - File and directory IO base class
0.6.$Revision: 279 $
package MyBaseClass; use base qw(Class::Usul::File);
Provides file and directory methods to the application base class
$absolute_path = $self->absolute( $base, $path );
Prepends $base to $path unless $path is an absolute path
$self->dump( @args );
Accepts either a list or a hash ref. Calls "dataclass_schema" with the storage_class attribute if supplied. Calls the dump method
$self->load( @args );
Accepts either a list or a hash ref. Calls "dataclass_schema" with the storage_class and arrays attributes if supplied. Calls the load method
$f_dc_schema_obj = $self->dataclass_schema( $attrs );
Returns a File::DataClass::Schema object. Object uses our exception_class, no caching and no locking by default. Works as a class method
exception_class
$self->delete_tmp_files( $dir );
Delete this processes temporary files. Files are in the $dir directory which defaults to $self->tempdir
$dir
$self->tempdir
$hash_ref = $self->extensions;
Class method that returns the extensions supported by File::DataClass::Storage
$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
$temporary_directory = $self->tempdir;
Returns $self->config->tempdir or "tmpdir" in File::Spec
$self->config->tempdir
$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
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) 2013 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 Class::Usul, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Usul
CPAN shell
perl -MCPAN -e shell install Class::Usul
For more information on module installation, please visit the detailed CPAN module installation guide.