File::Tasks::Add - A File::Tasks task to add a new file


File-Tasks documentation  | view source Contained in the File-Tasks distribution.

Index


NAME

Top

File::Tasks::Add - A File::Tasks task to add a new file

DESCRIPTION

Top

Objects of this class represent the addition of a new file to the filesystem. Specifically, they mean the creation of a new file where no existing file should exist.

Thus, when applying the task to a filesystem, it is first checked to ensure there is no existing file accidentally in the way.

METHODS

Top

new $Tasks, $path, $source

Creates a new File::Tasks::Add object, although you probably won't be creating this object directly from here.

Returns a new File::Tasks::Add object, or undef on error.

type

Returns the task type, which is always 'Add'.

path

The path accessor returns the path to the file within the set of tasks.

source

The source accessor returns the content source, which could be anything supported by File::Tasks::Provider.

test

The test method checks to see if the file can be added.

Returns true if so, or false if not.

execute

The execute method executes the task on the local filesystem.

Returns true on success or undef on error.

content

The content method returns the content that is to be written to the file.

SUPPORT

Top

Bugs should be reported via the CPAN bug tracker at

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Tasks

For other issues, contact the author.

AUTHOR

Top

Adam Kennedy <adamk@cpan.org>, http://ali.as/

COPYRIGHT

Top


File-Tasks documentation  | view source Contained in the File-Tasks distribution.