DBM::D...::File(3pm)
π NAME π
okay so this is the manual page for DBM::Deep::Storage::File, living under DBM::D...::File(3pm) in the User Contributed Perl Documentation pile. Its whole job is to mediate low-level interaction with the storage mechanism. That's the name-and-purpose vibe check, bestie. π
π§ 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. That's it. periodt π
π¦ OVERVIEW π¦
This class provides an abstraction to the storage mechanism so that the Engine β and yes, the original really says this is the only class that uses this class β doesn't have to worry about that. Main character energy for the Engine, honestly. β¨
π οΈ METHODS π οΈ
πΈ new( \%args ) πΈ
Signature check: new( \%args ). The original page doesn't hand us extra description for this one, so we're not inventing behavior. Ngl, respect. π«Ά
πΌ open() πΌ
This method opens the filehandle for the filename in file.
There is no return value. Zero, zilch, nada. π
π 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. Cute little method just chilling. π
π¦ set_inode() π¦
This will set the inode value of the underlying file object.
This is only needed to handle some obscure Win32 bugs. It really shouldn't be needed outside this object.
There is no return value.
β¨ print_at( $offset, @data ) β¨
This takes an offset and some data to print.
$offset 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.
If writing to the file would make the file too big for the pack_size, that is a fatal error. Not a vibe. π¨
π 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. Bye bestie, door's right there. π
π 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:
OnwerUID and GID β yes, the original spells it that way, and we keep the typo lore around here π- Permissions
Mwah πβ¨ β this page is from perl v5.42.0, dated 2023-11-13. Slay.
π¦ where this page comes from
- opensuse-leap 16.0: perl-DBM-Deep 2.0019-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms