Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    File::HStore 0.09

    Download button

    No screenshots available
    Downloads: 321  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Alexandre Dulaunoy | More programs
    Perl Artistic License / FREE
    October 10th, 2007, 04:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    File::HStore description

    File::HStore is a Perl extension to store files on a filesystem using a very simple hash-based storage.

    File::HStore is a Perl extension to store files on a filesystem using a very simple hash-based storage.

    SYNOPSIS

    use File::HStore;
    my $store = File::HStore ("/tmp/.mystore");

    # Add a file in the store
    my $id = $store->add("/foo/bar.txt");

    # Return the filesystem location of an id
    my $location = $store->getpath($id);

    # Remove a file by its id from the store
    $store->remove("ff3b73dd85beeaf6e7b34d678ab2615c71eee9d5")

    File-HStore is a very minimalist perl library to store files on a filesystem using a very simple hash-based storage.
    File-HStore is nothing more than a simple wrapper interface to a storage containing a specific directory structure where files are hold based on their hashes. The name of the directories is based on the first two bytes of the hexadecimal form of the digest. The file is stored and named with its full hexadecimal form in the corresponding prefixed directory.

    The current version is supporting the SHA-1 and SHA-2 (256 bits) algorithm. The FAT (Free Archive Toolkit) format is also supported and it is composed of the date of submission plus the SHA-2 real digest part.

    METHODS

    The object oriented interface to File::HFile is described in this section.

    The following methods are provided:

    $store = File::HStore->new($path,$digest,$prefix)

    This constructor returns a new File::HFile object encapsulating a specific store. The path specifies where the HStore is located on the filesystem. If the path is not specified, the path ~/.hstore is used. The digest specifies the algorithm to be used (SHA-1 or SHA-2 or the submission date called FAT). If not specified, SHA-1 is used. Various digest can be mixed in the same path but the utility is somewhat limited. The $prefix is only an extension used for the FAT (Free Archive Format) format to specify the archive unique name.

    $store->add($filename)

    The $filename is the file to be added in the store. The return value is the hash value ($id) of the $filename stored.

    Return undef on error.

    $store->getpath($id)

    Return the filesystem location of the file specified by its hash value.

    Return undef on error.

    $store->remove($hashvalue)

    The $hashvalue is the file to be removed from the store.

    Return false on success and undef on error.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    hash-based storage | file storage | Perl module | hash | filesystem | storage

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM