Doc #52366 [Asn->Csd]: flock() fails on gzopen()'d file pointer
| From: | aharvey@php.net | Date: | Mon, 19 Jul 2010 04:30:38 +0000 |
| Subject: | Doc #52366 [Asn->Csd]: flock() fails on gzopen()'d file pointer | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4706@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52366&edit=1
ID: 52366
Updated by: aharvey@php.net
Reported by: richard at on-the dot net
Summary: flock() fails on gzopen()'d file pointer
-Status: Assigned
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: ubuntu
PHP Version: 5.3.2
Assigned To: aharvey
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2010-07-19 06:30:28] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
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.
------------------------------------------------------------------------
[2010-07-19 05:48:13] aharvey@php.net
flock() only works on file resources and userspace streams that
implement the stream_lock() method. Internally, gzopen() actually
returns a gzip stream, rather than a file stream.
I'll update the flock() manual page to make the limitations on the
stream types supported clearer.
------------------------------------------------------------------------
[2010-07-17 17:21:02] richard at on-the dot net
Description:
------------
Documentation for gzopen() says it returns a file pointer so I expected
flock() to work on that file pointer but it doesn't.
Test script:
---------------
<?php
$fp = gzopen("filename",'wb');
if (!$fp) die("gzopen() failed\n");
if (!flock($fp,LOCK_EX)) die("flock() failed\n");
print "Success\n";
?>
Expected result:
----------------
Success
Actual result:
--------------
flock() failed
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52366&edit=1