CatalystX::CRUD::Object::File - filesystem CRUD instance


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

Index


NAME

Top

CatalystX::CRUD::Object::File - filesystem CRUD instance

SYNOPSIS

Top

 package My::File;
 use base qw( CatalystX::CRUD::Object::File );

 1;

DESCRIPTION

Top

CatalystX::CRUD::Object::File delegates to Path::Class:File.

METHODS

Top

Only new or overridden methods are documented here.

new( file => path/to/file )

Returns new CXCO::File object.

content

The contents of the delegate() file object. Set when you call read(). Set it yourself and call create() or update() as appropriate to write to the file.

create

Writes content() to a file. If the file already exists, will throw_error(), so call it like:

 -s $file ? $file->update : $file->create;

Returns the number of bytes written.

read

Slurp contents of file into content(). No check is performed as to whether the file exists, so call like:

 $file->read if -s $file;

update

Just like create() only no check is made if the file exists prior to writing to it. Returns the number of bytes written.

delete

Remove the file from the filesystem.

AUTHOR

Top

Peter Karman, <perl at peknet.com>

BUGS

Top

Please report any bugs or feature requests to bug-catalystx-crud at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CatalystX-CRUD. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc CatalystX::CRUD

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/CatalystX-CRUD

* CPAN Ratings

http://cpanratings.perl.org/d/CatalystX-CRUD

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=CatalystX-CRUD

* Search CPAN

http://search.cpan.org/dist/CatalystX-CRUD

COPYRIGHT & LICENSE

Top


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