File::CacheDir

Perl module to aid in keeping track and cleaning up files, quickly and without a cron
Download

File::CacheDir Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Earl Cahill
  • Publisher web site:
  • http://search.cpan.org/~earl/Log-Delimited-0.90/Delimited.pm

File::CacheDir Tags


File::CacheDir Description

Perl module to aid in keeping track and cleaning up files, quickly and without a cron File::CacheDir is a Perl module that attempts to keep files around for some ttl, while quickly, automatically and cronlessly cleaning up files that are too old.ARGUMENTSThe possible named arguments (which can be named or sent in a hash ref, see below for an example) are,base_dir - the base directory default is '/tmp/cache_dir'cache_stats - whether or not to try and cache -d checks default is 1carry_forward - whether or not to move forward the file when time periods get crossed. For example, if your ttl is 3600, and you move from the 278711 to the 278712 hour, if carry forward is set, it will refresh a cookie (if set_cookie is true) and move the file to the new location, and set $self->{carried_forward} = 1 default is 1cleanup_suffix - in order to avoid having more than one process attempt cleanup, a touch file, that looks like this "$cleanup_dir$self->{cleanup_suffix}" is created and cleaned up cleanup_fork - fork on cleanup default is 1 cleanup_frequency - percentage of time to attempt cleanup cleanup_length - seconds to allow for cleanup, that is, how old a touch file can be before a new cleanup process will startcontent_typed - whether or not you have printed a Content-type header default is 0cookie_brick_over - brick over an old cookie default is 0 cookie_name - the name of your cookie default is 'cache_dir'cookie_path - the path for your cookie default is '/'filename - what you want the file to be named (not including the directory), like "storebuilder" . time . $$ I would suggest using a script specific word (like the name of the cgi), time and $$ (which is the pid number) in the filename, just so files are easy to track and the filenames are pretty unique default is time . $$periods_to_keep - how many old periods you would like to keepset_cookie - whether or not to set a cookie default is 0ttl - how long you want the file to stick around can be given in seconds (3600) or like "1 hour" or "1 day" or even "1 week" default is '1 day' Requirements: · Perl


File::CacheDir Related Software