NAME

Template::Direct::Directory::File - Objectified access to files

SYNOPSIS

use Template::Direct::Directory::File;

my $file1 = $directory->new( File => 'file1.txt' );
my $file2 = Directory::File->new( File => '/Root/lib/file1.txt' );

DESCRIPTION

  Loads a directory for use with FileDirectives
	

METHODS

$class->new( $filename, %p )

Create a new file object.

OVERLOADED

$file->autocontents( )

Return the contents of a file when used in string context.

$file->save( $new_data, %options )

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

$file->append( $data, %p )

Same as save() but specify data is to be appended.

$file->load( %options )

Load data from file with options:

  * Quoting - Quote all data
  * Text    - Treat data as text and filter CR/LF

$file->path( )

Return the full path to this file objects location.

$file->filename( )

$file->name( )

Return the files name without path.

$file->parent( )

Return the parent Directory object to this file.

$file->exist( )

Return true is this file exists on the disk.

$file->clearCache( )

Clear this files cache (if it is cached)

$file->fromCache( )

Was this file loaded from cache? (used for testing)

$file->delete( )

Remove this file fromt he disk and close object.

$file->size( $h )

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)

$file->outofdate( )

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.

$file->modtime( )

When was the last time this file was modified.

$file->isfile( )

Returns true.

$file->isdir( )

Returns false

AUTHOR

Copyright, Martin Owens 2008, AGPL