22 Feb 2008 20:07:39 UTC
- Distribution: Template-Direct
- Module version: 1.00
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (39 / 7 / 1)
- KwaliteeBus factor: 0
- License: unknown
- Activity24 month
- Download (19.59KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionDOCTORMO Martin Owens
- $file->autocontents( )
- $file->save( $new_data, %options )
- $file->append( $data, %p )
- $file->load( %options )
- $file->path( )
- $file->filename( )
- $file->name( )
- $file->parent( )
- $file->exist( )
- $file->clearCache( )
- $file->fromCache( )
- $file->delete( )
- $file->size( $h )
- $file->outofdate( )
- $file->modtime( )
- $file->isfile( )
- $file->isdir( )
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.
Copyright, Martin Owens 2008, AGPL
Module Install Instructions
To install Template::Direct, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Template::Direct
For more information on module installation, please visit the detailed CPAN module installation guide.