GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
File::Flock::Subprocess(3) User Contributed Perl Documentation File::Flock::Subprocess(3)

 File::Flock::Subprocess - file locking with flock in a subprocess

 use File::Flock::Subprocess;

 lock($filename);

 lock($filename, 'shared');

 lock($filename, undef, 'nonblocking');

 lock($filename, 'shared', 'nonblocking');

 unlock($filename);

 lock_rename($oldfilename, $newfilename)

 my $lock = new File::Flock '/somefile';

 $lock->unlock();

 $lock->lock_rename('/new/file');

 forget_locks();

This is a wrapper around File::Flock that starts a subprocess and does the locking in the subprocess with File::Flock. The purpose of this is to handle operating systems (eg: Solaris) that do not retain locks across a call to fork().

The sub-process for this is created with fork() when File::Flock::Subprocess is compiled. I've tried to minimize the side-effects calling fork() by doing calling it early and by using POSIX::_exit() to quit but it is still worth being aware of. I suggest loading File::Flock::Subprocess early.

Use File::Flock::Forking to automatically detect when this is needed.

Read the docs for File::Flock for details of the API.

Any errors reported by the locking proxy File::Flock::Subprocess starts will be reported as "Compilation Failed" errors because the proxy is started in a BEGIN{} block.

Copyright (C) 2013 Google, Inc. This module may be used/copied/etc on the same terms as Perl itself.
2013-10-15 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.