Hub::Data::File - File


hub-standard documentation  | view source Contained in the hub-standard distribution.

Index


NAME

Top

Hub::Data::File - File

SYNOPSIS

Top



  use Hub qw(:standard);
  my $file = mkinst('File', 'foo.txt');
  print ${$file->get_content()};







DESCRIPTION

Top

A basic file which can be written and saved. It acts as a singleton and is integrated into the filecache system (supports refresh).

Intention

The FileSystem::snapshot method creates an image of the file system. Each file is an instance of this class. We delay reading from disk until it is necessary. We do not keep a file handle open.

PUBLIC METHODS

Top

new

Constructor.

delay_reading

Instruct FileCache to delay reading from disk

reload

Callback from FileCache when a read from disk is performed

get_data

Get a reference to the hash data defined in this file

get_content

Return file contents


 Usage: get_content [options]




options:



  -as_ref => 1         # Return a reference
  -text_only => 1      # Do not return binary data




set_content

Set file contents

save

Save file contents to disk


 Usage: save [options]




options: -priority => 'content' Content values presceed data values

set_sort_order

INTERNAL METHODS

Top

_merge_data_into_content

AUTHOR

Top

Ryan Gies (ryangies@livesite.net)

COPYRIGHT

Top

UPDATED

Top

08/02/2007


hub-standard documentation  | view source Contained in the hub-standard distribution.