Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

filecache(3perl) [debian man page]

FileCache(3perl)					 Perl Programmers Reference Guide					  FileCache(3perl)

NAME
FileCache - keep more files open than the system permits SYNOPSIS
no strict 'refs'; use FileCache; # or use FileCache maxopen => 16; cacheout $mode, $path; # or cacheout $path; print $path @data; $fh = cacheout $mode, $path; # or $fh = cacheout $path; print $fh @data; DESCRIPTION
The "cacheout" function will make sure that there's a filehandle open for reading or writing available as the pathname you give it. It automatically closes and re-opens files if you exceed your system's maximum number of file descriptors, or the suggested maximum maxopen. cacheout EXPR The 1-argument form of cacheout will open a file for writing ('>') on it's first use, and appending ('>>') thereafter. Returns EXPR on success for convenience. You may neglect the return value and manipulate EXPR as the filehandle directly if you prefer. cacheout MODE, EXPR The 2-argument form of cacheout will use the supplied mode for the initial and subsequent openings. Most valid modes for 3-argument "open" are supported namely; '>', '+>', '<', '<+', '>>', '|-' and '-|' To pass supplemental arguments to a program opened with '|-' or '-|' append them to the command string as you would system EXPR. Returns EXPR on success for convenience. You may neglect the return value and manipulate EXPR as the filehandle directly if you prefer. CAVEATS
While it is permissible to "close" a FileCache managed file, do not do so if you are calling "FileCache::cacheout" from a package other than which it was imported, or with another module which overrides "close". If you must, use "FileCache::cacheout_close". Although FileCache can be used with piped opens ('-|' or '|-') doing so is strongly discouraged. If FileCache finds it necessary to close and then reopen a pipe, the command at the far end of the pipe will be reexecuted - the results of performing IO on FileCache'd pipes is unlikely to be what you expect. The ability to use FileCache on pipes may be removed in a future release. FileCache does not store the current file offset if it finds it necessary to close a file. When the file is reopened, the offset will be as specified by the original "open" file mode. This could be construed to be a bug. The module functionality relies on symbolic references, so things will break under 'use strict' unless 'no strict "refs"' is also specified. BUGS
sys/param.h lies with its "NOFILE" define on some systems, so you may have to set maxopen yourself. perl v5.14.2 2010-12-30 FileCache(3perl)

Check Out this Related Man Page

Cache::FileCache(3pm)					User Contributed Perl Documentation				     Cache::FileCache(3pm)

NAME
Cache::FileCache -- implements the Cache interface. DESCRIPTION
The FileCache class implements the Cache interface. This cache stores data in the filesystem so that it can be shared between processes. SYNOPSIS
use Cache::FileCache; my $cache = new Cache::FileCache( { 'namespace' => 'MyNamespace', 'default_expires_in' => 600 } ); See Cache::Cache for the usage synopsis. METHODS
See Cache::Cache for the API documentation. Clear( [$cache_root] ) See Cache::Cache, with the optional $cache_root parameter. Purge( [$cache_root] ) See Cache::Cache, with the optional $cache_root parameter. Size( [$cache_root] ) See Cache::Cache, with the optional $cache_root parameter. OPTIONS
See Cache::Cache for standard options. Additionally, options are set by passing in a reference to a hash containing any of the following keys: cache_root The location in the filesystem that will hold the root of the cache. Defaults to the 'FileCache' under the OS default temp directory ( often '/tmp' on UNIXes ) unless explicitly set. cache_depth The number of subdirectories deep to cache object item. This should be large enough that no cache directory has more than a few hundred objects. Defaults to 3 unless explicitly set. directory_umask The directories in the cache on the filesystem should be globally writable to allow for multiple users. While this is a potential security concern, the actual cache entries are written with the user's umask, thus reducing the risk of cache poisoning. If you desire it to only be user writable, set the 'directory_umask' option to '077' or similar. Defaults to '000' unless explicitly set. PROPERTIES
See Cache::Cache for default properties. (get|set)_cache_root See the definition above for the option cache_root (get|set)_cache_depth See the definition above for the option cache_depth (get|set)_directory_umask See the definition above for the option directory_umask SEE ALSO
Cache::Cache AUTHOR
Original author: DeWitt Clinton <dewitt@unto.net> Last author: $Author: dclinton $ Copyright (C) 2001-2003 DeWitt Clinton perl v5.12.4 2009-03-01 Cache::FileCache(3pm)
Man Page