NAME

Archive::SCS - SCS archive controller

SYNOPSIS

my $scs = Archive::SCS->new;
$scs->mount("$path/base.scs");
$scs->mount("$path/def.scs");

my @contents = sort $scs->list_dirs, $scs->list_files;

say $scs->read_entry('version.txt');

DESCRIPTION

Handles SCS archive files. Allows mounting of multiple files and performs lookups in all of them using the SCS hash algorithm.

Note that this software currently requires String::CityHash version 0.10, which is only available on BackPAN.

METHODS

formats

@formats = $scs->formats;

list_dirs

@directories = $scs->list_dirs;

list_files

@files = $scs->list_files;

list_orphans

@orphan_hashes = $scs->list_orphans;

Some file formats allow files (or subdirs) without a directory entry. These files may be accessed directly using their hash value. This software refers to such files as orphans. For example, the following orphans are known to exist in 1.49.3.14:

05c075dc23d8d177 # in core.scs
0eeaffbe65995414 # in base.scs + core.scs
0fb3a3294f8ac99c # in base_cfg.scs
2a794836b65afe88 # in base.scs
34f7048e2d3b04b6 # in core.scs
507dcc5fb3fb6443 # in core.scs
83a9902d7733b94d # in core.scs
88a1194cb25b253c # in core.scs, 'ui/desktop_standalone_demo.sii'
c09356068ea66aac # in core.scs
d9d3d2a218c69f3d # in base.scs
e773fb1407c8468d # in core.scs

mount

$archive = $scs->mount($pathname);

read_entry

$data = $scs->read_entry($pathname);
$data = $scs->read_entry($hash);

The argument may be the pathname within the archive or its hash value, hex-encoded in network byte order as a 16-byte scalar PV.

set_formats

$scs = $scs->set_formats(qw[ HashFS Zip ]);

unmount

$archive = $scs->unmount($pathname);

SEE ALSO

AUTHOR

nautofon

COPYRIGHT

This software is copyright (c) 2024 by nautofon.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.