HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/ri/3.0.0/system/File/flock-i.ri
U:RDoc::AnyMethod[iI"
flock:ETI"File#flock;TF:publico:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph;	[
I"ELocks or unlocks a file according to <i>locking_constant</i> (a ;TI"<logical <em>or</em> of the values in the table below). ;TI"FReturns <code>false</code> if File::LOCK_NB is specified and the ;TI"Boperation would otherwise have blocked. Not available on all ;TI"platforms.;To:RDoc::Markup::BlankLineo;
;	[I"'Locking constants (in class File):;T@o:RDoc::Markup::Verbatim;	[I">LOCK_EX   | Exclusive lock. Only one process may hold an
;TI"<          | exclusive lock for a given file at a time.
;TI"A----------+------------------------------------------------
;TI";LOCK_NB   | Don't block when locking. May be combined
;TI";          | with other lock options using logical or.
;TI"A----------+------------------------------------------------
;TI"ALOCK_SH   | Shared lock. Multiple processes may each hold a
;TI"@          | shared lock for a given file at the same time.
;TI"A----------+------------------------------------------------
;TI"LOCK_UN   | Unlock.
;T:@format0o;
;	[I"
Example:;T@o;;	[I")# update a counter using write lock
;TI"@# don't use "w" because it truncates the file before lock.
;TI"=File.open("counter", File::RDWR|File::CREAT, 0644) {|f|
;TI"  f.flock(File::LOCK_EX)
;TI"  value = f.read.to_i + 1
;TI"  f.rewind
;TI"  f.write("#{value}\n")
;TI"  f.flush
;TI"  f.truncate(f.pos)
;TI"}
;TI"
;TI"(# read the counter using read lock
;TI"$File.open("counter", "r") {|f|
;TI"  f.flock(File::LOCK_SH)
;TI"  p f.read
;TI"};T;
0:
@fileI"file.c;T:0@omit_headings_from_table_of_contents_below0I"0file.flock(locking_constant) -> 0 or false
;T0[I"	(p1);T@7FI"	File;TcRDoc::NormalClass00