14 May 2013 06:53:16 UTC
- Distribution: DataStore-CAS-FS
- Module version: 0.011000
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (342 / 39 / 0)
- KwaliteeBus factor: 1
- 66.63% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity24 month
- Download (53.86KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionNERDVANA Michael Conradand 1 contributors
- Michael Conrad
DataStore::CAS::FS::DirCodec::Unix - Efficiently encode only the attributes of a UNIX stat()
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
Michael Conrad <email@example.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.
Module Install Instructions
To install DataStore::CAS::FS, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install DataStore::CAS::FS
For more information on module installation, please visit the detailed CPAN module installation guide.