Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    Tie::DB_FileLock 0.10

    Download button

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

    License / Price:

    Last Updated:

    Category:
    John M Vinopal | More programs
    Perl Artistic License / FREE
    November 20th, 2008, 12:17 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Tie::DB_FileLock description

    Locking access to Berkeley DB 1.x

    Tie::DB_FileLock is a Perl module that offers locking access to Berkeley DB 1.x.

    SYNOPSIS

     use Tie::DB_FileLock;

     [$X =] tie %hash, 'Tie::DB_FileLock', [$file, $flags, $mode, $DB_HASH];
     [$X =] tie %hash, 'Tie::DB_FileLock', $file, $flags, $mode, $DB_BTREE;

     $X->debug($value);

     $status = $X->del($key [, $flags]);
     $status = $X->put($key, $value [, $flags]);
     $status = $X->get($key, $value [, $flags]);
     $status = $X->seq($key, $value, $flags);
     $status = $X->sync([$flags]);
     $status = $X->fd();

     # BTREE only
     $count = $X->get_dup($key);
     @list = $X->get_dup($key);
     %list = $X->get_dup($key, 1);
     $status = $X->find_dup($key, $value);
     $status = $X->del_dup($key, $value);

     # DBM Filters
     $old_filter = $db->filter_store_key ( sub { ... } );
     $old_filter = $db->filter_store_value( sub { ... } );
     $old_filter = $db->filter_fetch_key ( sub { ... } );
     $old_filter = $db->filter_fetch_value( sub { ... } );

     [undef $X;]
     untie %hash;


    Module DB_File allows perl to tie hashes to on-disk dbm files, but fails to provide any method by which the hashes might be locked, providing exclusive access or preventing page-level collisions. Tie::DB_FileLock extends DB_File, providing a locking layer using flock().

    Unlike Tie::DB_Lock, Tie::DB_FileLock does not duplicate files to allow concurrent access for readers and writers. Tie::DB_FileLock is therefore suitable for large dbms with relatively short locking periods.

    Tie::DB_FileLock is designed as a drop-in replacement for DB_File, requiring minimal code changes. Change all occurrences of "DB_File" to "Tie::DB_FileLock" and all should be well. DB_RECNO is not presently supported by Tie::DB_FileLock.

    Arguments to Tie::DB_FileLock are identical as those to DB_File. The dbm is locked for shared access if opened RO, exclusively otherwise. The default, as in DB_File, is read/write/create.

    Use of the predefined references $DB_HASH, $DB_BTREE, and $DB_RECNO, is identical as with DB_File. When creating your own, the new call is the same, but the object created is a DB_File::XXX thing and not a Tie::DB_FileLock::XXX thing -- therefore error messages will refer to DB_File::XXX.


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    locking access | Berkeley DB | Perl module | Perl | Berkeley | database

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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