svn: /phpdoc/en/trunk/reference/filesystem/functions/ flock.xml

From: Date: Mon, 19 Jul 2010 04:30:25 +0000
Subject: svn: /phpdoc/en/trunk/reference/filesystem/functions/ flock.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-6893@lists.php.net to get a copy of this message
aharvey Mon, 19 Jul 2010 04:30:25 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=301386 Log: Fix doc bug #52366 (flock() fails on gzopen()'d file pointer) by making it clearer that flock() only works on actual file handles. Also fixed a couple of grammatical problems, and added a more detailed explanation of when mandatory locking will be used that's hopefully more or less accurate. Bug: http://bugs.php.net/52366 (Assigned) flock() fails on gzopen()'d file pointer Changed paths: U phpdoc/en/trunk/reference/filesystem/functions/flock.xml Modified: phpdoc/en/trunk/reference/filesystem/functions/flock.xml =================================================================== --- phpdoc/en/trunk/reference/filesystem/functions/flock.xml 2010-07-19 03:00:35 UTC (rev 301385) +++ phpdoc/en/trunk/reference/filesystem/functions/flock.xml 2010-07-19 04:30:25 UTC (rev 301386) @@ -20,8 +20,9 @@ derivatives and even Windows). </para> <para> - The lock is released also by <function>fclose</function> (which is also - called automatically when script finished). + On versions of PHP before 5.3.2, the lock is released also by + <function>fclose</function> (which is also called automatically when script + finished). </para> <para> PHP supports a portable way of locking complete files in an advisory way @@ -39,9 +40,7 @@ <varlistentry> <term><parameter>handle</parameter></term> <listitem> - <para> - An open file pointer. - </para> + &fs.file.pointer; </listitem> </varlistentry> <varlistentry> @@ -182,8 +181,12 @@ &reftitle.notes; <note> <para> - <function>flock</function> locks mandatory under Windows aswell as some - POSIX based operating systems. + <function>flock</function> uses mandatory locking instead of advisory + locking on Windows. Mandatory locking is also supported on Linux and + System V based operating systems via the usual mechanism supported by the + fcntl() system call: that is, if the file in question has the setgid + permission bit set and the group execution bit cleared. On Linux, the file + system will also need to be mounted with the mand option for this to work. </para> </note> <note> @@ -194,10 +197,17 @@ <function>fopen</function>). </para> </note> + <note> + <para> + May only be used on file pointers returned by <function>fopen</function> + for local files, or file pointers pointing to userspace streams that + implement the <function>streamWrapper::stream_lock</function> method. + </para> + </note> <warning> <para> - Assigning other value to <parameter>handle</parameter> argument in the - consecutive code would release the lock. + Assigning another value to <parameter>handle</parameter> argument in + subsequent code will release the lock. </para> </warning> <warning>

« previous php.doc.cvs (#6893) next »