CVS update: php3/doc/functions
| From: | sas | Date: | Thu, 27 May 1999 14:14:27 +0000 |
| Subject: | CVS update: php3/doc/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6071@lists.php.net to get a copy of this message | ||
Date: Thursday May 27, 1999 @ 10:14
Author: sas
Update of /repository/php3/doc/functions
In directory php:/tmp/cvs-serv11897
Modified Files:
filesystem.sgml
Log Message:
- improve flock docu
Index: php3/doc/functions/filesystem.sgml
diff -u php3/doc/functions/filesystem.sgml:1.48 php3/doc/functions/filesystem.sgml:1.49
--- php3/doc/functions/filesystem.sgml:1.48 Wed May 19 23:58:12 1999
+++ php3/doc/functions/filesystem.sgml Thu May 27 10:14:27 1999
@@ -727,7 +727,7 @@
<refentry id="function.flock">
<refnamediv>
<refname>flock</refname>
- <refpurpose>portable file locking</refpurpose>
+ <refpurpose>portable advisory file locking</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@@ -737,24 +737,44 @@
<paramdef>int <parameter>operation</parameter></paramdef>
</funcsynopsis>
<simpara>
- PHP supports a portable way of locking whole files in an
- advisory way (which means all accessing programs have to
- use the same way of locking or it will not work).
+ PHP supports a portable way of locking complete files in an advisory way
+ (which means all accessing programs have to use the same way of locking
+ or it will not work).
<simpara>
- To lock a file, you have to open it first and pass the
- resulting file pointer to flock. The operations you can
- use are 1 for locking the file as a reader (shared lock),
- 2 for locking the file as a writer (exclusive lock) and
- 3 for releasing a lock. This enables a simple reader/writer
- model which can be used on almost every platform (including
- most Unixes and even Windows).
+ <function>flock</function> operates on <parameter>fp</parameter> which
+ must be an open file pointer. <parameter>operation</parameter> is one of
+ the following values:
+
+ <para>
+ <itemizedlist>
+ <listitem><simpara>
+ To acquire a shared lock (reader), set <parameter>operation</parameter>
+ to 1.
+
+ <listitem><simpara>
+ To acquire an exclusive lock (writer), set
+ <parameter>operation</parameter> to 2.
+
+ <listitem><simpara>
+ To release a lock (shared or exclusive), set
+ <parameter>operation</parameter> to 3.
+
+ <listitem><simpara>
+ If you don't want <function>flock</function> to block while locking,
+ add 4 to <parameter>operation</parameter>.
+
+ </itemizedlist>
+ </para>
+
+ <simpara>
+ <function>flock</function> allows you to perform a simple reader/writer
+ model which can be used on virtually every platform (including most
+ Unices and even Windows).
<simpara>
- If you add 4 to the operation parameter, locking will be tried
- in a non-blocking way. It returns false, if the lock cannot
- be acquired non-blocking. Otherwise, flock will always
- return true.
+ <function>flock</function> returns true on success and false on error
+ (e.g. when a lock could not be acquired).
</refsect1>
</refentry>
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net