dbm::deep::storage::file(3pm) [debian man page]
DBM::Deep::Storage::File(3pm) User Contributed Perl Documentation DBM::Deep::Storage::File(3pm) NAME
DBM::Deep::Storage::File - mediate low-level interaction with storage mechanism PURPOSE
This is an internal-use-only object for DBM::Deep. It mediates the low-level interaction with the storage mechanism. Currently, the only storage mechanism supported is the file system. OVERVIEW
This class provides an abstraction to the storage mechanism so that the Engine (the only class that uses this class) doesn't have to worry about that. METHODS
new( \%args ) open() This method opens the filehandle for the filename in " file ". There is no return value. close() If the filehandle is opened, this will close it. There is no return value. size() This will return the size of the DB. If file_offset is set, this will take that into account. NOTE: This function isn't used internally anywhere. set_inode() This will set the inode value of the underlying file object. This is only needed to handle some obscure Win32 bugs. It reqlly shouldn't be needed outside this object. There is no return value. print_at( $offset, @data ) This takes an optional offset and some data to print. $offset , if defined, will be used to seek into the file. If file_offset is set, it will be used as the zero location. If it is undefined, no seeking will occur. Then, @data will be printed to the current location. There is no return value. read_at( $offset, $length ) This takes an optional offset and a length. $offset , if defined, will be used to seek into the file. If file_offset is set, it will be used as the zero location. If it is undefined, no seeking will occur. Then, $length bytes will be read from the current location. The data read will be returned. DESTROY When the ::Storage::File object goes out of scope, it will be closed. request_space( $size ) This takes a size and adds that much space to the DBM. This returns the offset for the new location. copy_stats( $target_filename ) This will take the stats for the current filehandle and apply them to $target_filename . The stats copied are: o Onwer UID and GID o Permissions perl v5.14.2 2012-06-24 DBM::Deep::Storage::File(3pm)
Check Out this Related Man Page
DBM::Deep::Internals(3pm) User Contributed Perl Documentation DBM::Deep::Internals(3pm) NAME
DBM::Deep::Internals - Out of date documentation on DBM::Deep internals OUT OF DATE
This document is out-of-date. It describes an intermediate file format used during the development from 0.983 to 1.0000. It will be rewritten soon. So far, the description of the header format has been updated. DESCRIPTION
This is a document describing the internal workings of DBM::Deep. It is not necessary to read this document if you only intend to be a user. This document is intended for people who either want a deeper understanding of specifics of how DBM::Deep works or who wish to help program DBM::Deep. CLASS LAYOUT
DBM::Deep is broken up into five classes in three inheritance hierarchies. o DBM::Deep is the parent of DBM::Deep::Array and DBM::Deep::Hash. These classes form the immediate interface to the outside world. They are the classes that provide the TIE mechanisms as well as the OO methods. o DBM::Deep::Engine is the layer that deals with the mechanics of reading and writing to the file. This is where the logic of the file layout is handled. o DBM::Deep::File is the layer that deals with the physical file. As a singleton that every other object has a reference to, it also provides a place to handle datastructure-wide items, such as transactions. FILE LAYOUT
This describes the 1.0003 and 2.0000 formats, which internally are numbered 3 and 4, respectively. The internal numbers are used in this section. These two formats are almost identical. DBM::Deep uses a tagged file layout. Every section has a tag, a size, and then the data. File header The file header consists of two parts. The first part is a fixed length of 13 bytes: DPDB h VVVV SSSS / | / '---. '--- size of the second part of the header file '--- version signature tag o File Signature The first four bytes are 'DPDB' in network byte order, signifying that this is a DBM::Deep file. o File tag A literal ASCII 'h', indicating that this is the header. The file used by versions prior to 1.00 had a different fifth byte, allowing the difference to be determined. o Version This is four bytes containing the file version. This lets the file format change over time. It is packed in network order, so version 4 is stored as "