Parano...THeader(3pm)
π Paranoid::IO::FileMultiplexer::Block::BATHeader β the BAT Header Block β¨
okay bestie, so this is a page from the User Contributed Perl Documentation situation, and it's all about the BAT Header Block for Paranoid::IO::FileMultiplexer. buckle up π
πΈ VERSION πΈ
$Id: lib/Paranoid/IO/FileMultiplexer/Block/BATHeader.pm, 2.10 2022/03/08 00:01:04 acorliss Exp $
that's the version info fr fr π
β¨ SYNOPSIS β¨
$obj = Paranoid::IO::FileMultiplexer::Block::BATHeader->new($file,
$blockNo, $blockSize, $strmName, $sequenceNo);
$max = $obj->maxData;
$seq = $obj->sequence;
@data = $obj->dataBlocks;
$rv = $obj->full;
$rv = $obj->writeSig;
$rv = $obj->readSig;
$rv = $obj->writeData;
$rv = $obj->readData;
$rv = $obj->addData($bn);
look at her go π so many methods, so little time
π¦ DESCRIPTION π¦
so, real talk β this class is not meant to be used directly, okay? it's a supporting character, part of the Paranoid::IO::FileMultiplexer functionality. it provides the functionality necessary for manipulation of the stream header block. lowkey important, highkey not for you to touch directly π
here's the thing though, this module does presume that whatever file it's being used on has already been opened in the appropriate mode, and that the Paranoid::IO flock stack has been enabled. for the purposes of Paranoid::IO::FileMultiplexer, that's all done in that class. so if you're out here raw-dogging this module without that setup, that's on you bestie π
π SUBROUTINES/METHODS π
π new
$obj = Paranoid::IO::FileMultiplexer::Block::BATHeader->new($file,
$blockNo, $blockSize, $strmName, $sequenceNo);
this creates a new instance of a BAT header block object, periodt. it requires the filename in order to retrieve the cached file handle from Paranoid::IO, the block number of the block, the size of the block, the name of the stream, and the block sequence number. five things, no more, no less π
NOTE: creating an object does not automatically create the file and/or write a signature. that must be done using the methods below. so don't come crying to me when nothing's on disk yet π
π«Ά maxData
$max = $obj->maxData;
this method returns the maximum number of data blocks that can be tracked in a single BAT block. it's giving capacity π
β sequence
$seq = $obj->sequence;
this method returns the sequence number of the BAT. in essence, this is the ordinal index of the BAT in a stream's array of BATs. so like, which one is she in the lineup π
π§ dataBlocks
@data = $obj->dataBlocks;
this method returns the list of data blocks being tracked by this BAT. the whole roster, no cap π₯
π full
$rv = $obj->full;
this method returns a boolean value denoting whether this BAT's array of data blocks is at maximum capacity or not. true = she's booked and busy, no more room β¨
πΈ writeSig
$rv = $obj->writeSig;
this method writes the BAT header signature to disk, returning a boolean value denoting its success. note that the signature contains the file format, stream name, and the BAT sequence number. this does not include the allocated data block numbers. so it's just the vibe check of the header, not the whole guest list π
π readSig
$rv = $obj->readSig;
this method reads the BAT header signature from disk and performs basic validation that the information in it is acceptable. it validates that the stream name and sequence number matches what is expected and the block format is correct. she's checking receipts π
if the method call was successful it will update the cached values in the object. note that this is only the signature values, not the data block numbers. don't get it twisted π«Ά
π writeData
$rv = $obj->writeData;
this method writes the data block numbers to the header block, and returns a boolean denoting success. slay π
π readData
$rv = $obj->readData;
this method reads the data block numbers from the file, and returns a boolean value denoting success. if the read is successful, this will update the cached data blocks in the object. freshly loaded β¨
π₯ addData
$rv = $obj->addData($bn);
this method does some basic validation of the requested BAT, and if it passes, updates the data block number list on the disk. gatekept and validated, as she should be π
π DEPENDENCIES π
she does not stand alone, bestie. she needs:
FcntlParanoidParanoid::DebugParanoid::DataParanoid::IOParanoid::IOFileMultiplexer::Block
the whole girl gang π«Ά
π BUGS AND LIMITATIONS π
...nothing here. literally empty. no bugs, no limitations, no notes. the silence is deafening π she ate and left no crumbs.
π AUTHOR π
Arthur Corliss (corliss@digitalmages.com) β the icon, the legend, the moment π
π LICENSE AND COPYRIGHT π
This software is free software. Similar to Perl, you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License <https://www.gnu.org/licenses/gpl-1.0.html> as published by the Free Software Foundation <http://www.fsf.org/>; either version 1 <https://www.gnu.org/licenses/gpl-1.0.html>, or any later version <https://www.gnu.org/licenses/license-list.html#GNUGPL>, or
b) the Artistic License 2.0 <https://opensource.org/licenses/Artistic-2.0>,
subject to the following additional term: No trademark rights to "Paranoid" have been or are conveyed under any of the above licenses. However, "Paranoid" may be used fairly to describe this unmodified software, in good faith, but not as a trademark.
(c) 2005 - 2021, Arthur Corliss (corliss@digitalmages.com) (tm) 2008 - 2021, Paranoid Inc. (www.paranoid.com)
and that's the whole page, bestie π this was pulled straight outta perl v5.38.2 and dated 2024-03-07 β yeah, she's a 2024 girlie. go forth and multiplex responsibly πβ¨π¦
π¦ where this page comes from
- debian trixie: libparanoid-perl 2.10-2 Β· other
- ubuntu resolute: libparanoid-perl 2.10-2 Β· other
- ubuntu stonking: libparanoid-perl 2.10-2 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms