1File::Flock::SubprocessU(s3e)r Contributed Perl DocumentaFtiiloen::Flock::Subprocess(3)
2
3
4
6 File::Flock::Subprocess - file locking with flock in a subprocess
7
9 use File::Flock::Subprocess;
10
11 lock($filename);
12
13 lock($filename, 'shared');
14
15 lock($filename, undef, 'nonblocking');
16
17 lock($filename, 'shared', 'nonblocking');
18
19 unlock($filename);
20
21 lock_rename($oldfilename, $newfilename)
22
23 my $lock = new File::Flock '/somefile';
24
25 $lock->unlock();
26
27 $lock->lock_rename('/new/file');
28
29 forget_locks();
30
32 This is a wrapper around File::Flock that starts a subprocess and does
33 the locking in the subprocess with File::Flock. The purpose of this is
34 to handle operating systems (eg: Solaris) that do not retain locks
35 across a call to fork().
36
37 The sub-process for this is created with fork() when
38 File::Flock::Subprocess is compiled. I've tried to minimize the side-
39 effects calling fork() by doing calling it early and by using
40 POSIX::_exit() to quit but it is still worth being aware of. I suggest
41 loading File::Flock::Subprocess early.
42
43 Use File::Flock::Forking to automatically detect when this is needed.
44
45 Read the docs for File::Flock for details of the API.
46
48 Any errors reported by the locking proxy File::Flock::Subprocess starts
49 will be reported as "Compilation Failed" errors because the proxy is
50 started in a BEGIN{} block.
51
53 Copyright (C) 2013 Google, Inc. This module may be used/copied/etc on
54 the same terms as Perl itself.
55
56
57
58perl v5.30.1 2020-01-30 File::Flock::Subprocess(3)