summaryrefslogtreecommitdiff
path: root/README.STREAMS
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-03-04 21:46:33 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-03-04 21:46:33 +0000
commit6efd9ea5c4f5d1d849bc5885050b87d0bf2cff10 (patch)
tree06820e0199a1441e6808244f75d0e0e73a5d25a3 /README.STREAMS
parentcf7101d354d37a9a9cd905e39d451281048357bd (diff)
downloadphp-git-6efd9ea5c4f5d1d849bc5885050b87d0bf2cff10.tar.gz
Added notes about locking functions.
Diffstat (limited to 'README.STREAMS')
-rw-r--r--README.STREAMS8
1 files changed, 7 insertions, 1 deletions
diff --git a/README.STREAMS b/README.STREAMS
index 16108cc822..f625406a3b 100644
--- a/README.STREAMS
+++ b/README.STREAMS
@@ -37,9 +37,10 @@ PHPAPI int php_stream_close(php_stream * stream);
PHPAPI int php_stream_flush(php_stream * stream);
PHPAPI int php_stream_seek(php_stream * stream, off_t offset, int whence);
PHPAPI off_t php_stream_tell(php_stream * stream);
+PHPAPI int php_stream_lock(php_stream * stream, int mode);
These (should) behave in the same way as the ANSI stdio functions with similar
-names: fread, fwrite, fprintf, feof, fgetc, fgets, fclose, fflush, fseek, ftell.
+names: fread, fwrite, fprintf, feof, fgetc, fgets, fclose, fflush, fseek, ftell, flock.
Opening Streams
===============
@@ -157,6 +158,11 @@ can lead to a crash when the resource is later used/released.
NOTE: If you are opening a stream and need it to be seekable, use the
STREAM_MUST_SEEK option to php_stream_open_wrapper();
+PHPAPI int php_stream_supports_lock(php_stream * stream);
+
+This function will return either 1 (success) or 0 (failure) indicating whether or
+not a lock can be set on this stream. Typically you can only set locks on stdio streams.
+
Casting Streams
===============
What if your extension needs to access the FILE* of a user level file pointer?