DataStore::CAS::FS::DirCodec::Unix - Efficiently encode only the attributes of a UNIX stat()
version 0.0101
This directory encoder/decoder encodes only the fields of a DirEnt corresponding to a unix stat_t structure. (or more precisely, the fields perl returns from the stat function) Any other fields in the DirEnt are ignored.
It does this much more efficiently than would be done in JSON, but still uses text, to avoid complications of endian-ness and word size. (and because 32-bit perl can't numerically process 64-bit integers) The encoding is further optimized by ordering the fields by likelyhood of being used, and truncating records at the last used field.
It also imposes some restrictions: 'name' and 'ref' must each be less than 256 bytes when encoded as UTF-8. There is also a limitation on the unix stat values, but they will all fit even with max-length 64 bit integers, so this shouldn't ever be a problem.
$serialized= $class->encode( \@entries, \%metadata )
See DirCodec->encode for details.
my $dir= $class->decode( \%params )
See DirCodec->load for details on %params.
%params
Michael Conrad <mconrad@intellitree.com>
This software is copyright (c) 2013 by Michael Conrad, and IntelliTree Solutions llc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install DataStore::CAS::FS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DataStore::CAS::FS
CPAN shell
perl -MCPAN -e shell install DataStore::CAS::FS
For more information on module installation, please visit the detailed CPAN module installation guide.