Template::Direct::Directory::File - Objectified access to files
use Template::Direct::Directory::File; my $file1 = $directory->new( File => 'file1.txt' ); my $file2 = Directory::File->new( File => '/Root/lib/file1.txt' );
Loads a directory for use with FileDirectives
Create a new file object.
Return the contents of a file when used in string context.
Save $new_data as the new file contents. Options: * Append - Boolean to specifiy data is to be appended. * Text - Treat data as text and do CR/LF filtering
Same as save() but specify data is to be appended.
Load data from file with options: * Quoting - Quote all data * Text - Treat data as text and filter CR/LF
Return the full path to this file objects location.
Return the files name without path.
Return the parent Directory object to this file.
Return true is this file exists on the disk.
Clear this files cache (if it is cached)
Was this file loaded from cache? (used for testing)
Remove this file fromt he disk and close object.
Returns size of file as number of bytes unless $h is true in which case it returns the most relivent size metric (i.e KB/MB/GB)
Returns true if the file is out of date (used internally) The file with automatically reload contents if it's out of date when used so there isn't a need to use this for content.
When was the last time this file was modified.
Returns true.
Returns false
Copyright, Martin Owens 2008, AGPL
To install Template::Direct, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Direct
CPAN shell
perl -MCPAN -e shell install Template::Direct
For more information on module installation, please visit the detailed CPAN module installation guide.