The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Dir::Flock::Mock - builtin flock advisory file locking wrapped in Dir::Flock API

VERSION

0.03

SYNOPSIS

    use Dir::Flock;
    if (Dir_Flock_wont_work_for_some_reason()) {
        require Dir::Flock::Mock;
    }
    ...

DESCRIPTION

Dir::Flock implements advisory locking of a directory for supported systems. On supported systems (like MSWin32 or FAT32) the normal flock scheme should work. This module mocks the Dir::Flock package on a foundation of the builtin flock function, so Dir::Flock can be deployed on the systems that otherwise can't use it as well as the systems that need it.

To deploy Dir::Flock::Mock, you should assess whether it is needed, and then load this module with require.

    use Dir::Flock;
    if (Dir_Flock_wont_work_here()) {
        require Dir::Flock::Mock;
    }

Loading this module has the effect of overloading all the public function calls in Dir::Flock with their flock-based Dir::Flock::Mock versions. No other changes to the Dir::Flock function calls should be necessary.

FUNCTIONS

See Dir::Flock for the set of supported functions and their semantics.

AUTHOR

Marty O'Brien, <mob@cpan.org>

LICENSE AND COPYRIGHT

Copyright (c) 2019, Marty O'Brien

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

See http://dev.perl.org/licenses/ for more information.