From 798e9d2a6b78abc82aa9c25c2ec142d9a05a9883 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Fri, 4 Jan 2002 22:19:25 +0000 Subject: [PATCH] documented dio-functions still open: dio_fnctl (cmd params) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@66932 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/dio.xml | 147 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 126 insertions(+), 21 deletions(-) diff --git a/functions/dio.xml b/functions/dio.xml index 4490094d37..c5cdbca9f5 100644 --- a/functions/dio.xml +++ b/functions/dio.xml @@ -1,20 +1,31 @@ - + Direct IO functions DIO functions - - Undocumented - +
+ Direct I/O Functions + + PHP supports the direct io functions as described in the Posix + Standard (Section 6) for performing I/O functions at a lower + level than the C-Language stream I/O functions (fopen, fread,..). + +
+
+ Installation + + To get these functions to work, you have to configure PHP with + . + +
- - + dio_open - Open a new filename with specified permissions of flags and creation permissions of mode + Opens a new filename with specified permissions of flags and creation permissions of mode Description @@ -29,7 +40,32 @@ - &warn.undocumented.func; + dio_open opens a file and returns a new + file descriptor for it, or -1 if any error occured. + If flags is O_CREAT, optional third parameter + mode will set the mode of the file + (creation permissions). + The flags parameter can be one of the + following options: + + O_RDONLY - opens the file for read access + O_WRONLY - opens the file for write access + O_RDWR - opens the file for both reading and + writing + + The flags parameter can also include any + combination of the following flags: + + O_CREAT - creates the file, if it doesn't + already exist + O_EXCL - if both, O_CREAT and O_EXCL are set, + dio_open fails, if file already exists. + O_TRUNC - if file exists, and its opened + for write access, file will be truncated to zero length. + O_APPEND - write operations write data at the + end of file + O_NONBLOCK - sets non blocking mode + @@ -37,7 +73,7 @@ dio_read - Read n bytes from fd and return them, if n is not specified, read 1k + Reads n bytes from fd and returns them, if n is not specified, reads 1k block Description @@ -51,7 +87,11 @@ - &warn.undocumented.func; + The function dio_read reads and returns + n bytes from file with descriptor + resource. If n is + not specified, dio_read reads 1K sized block and + returns them. @@ -59,7 +99,7 @@ dio_write - Write data to fd with optional truncation at length + Writes data to fd with optional truncation at length Description @@ -74,7 +114,14 @@ - &warn.undocumented.func; + The function dio_write + writes up to len bytes from + data to file fd. If + len is not specified, + dio_write writes all + data to the specified + file. dio_write returns the number of bytes + written to fd. @@ -82,7 +129,7 @@ dio_truncate - Truncate file descriptor fd to offset bytes + Truncates file descriptor fd to offset bytes Description @@ -94,7 +141,14 @@ - &warn.undocumented.func; + Function dio_truncate causes the file + referenced by fd to be truncated to at + most offset bytes in size. If the + file previously was larger than this size, the extra data + is lost. If the file previously was shorter, it is + unspecified whether the file is left unchanged or is + extended. In the latter case the extended part reads as + zero bytes. Returns 0 on success, otherwise -1 @@ -102,7 +156,7 @@ dio_stat - Get stat information about the file descriptor fd + Gets stat information about the file descriptor fd Description @@ -113,7 +167,28 @@ - &warn.undocumented.func; + Function fstat returns information about + the file with file descriptor + fd. dio_stat returns + an associative array with the following keys: + + "device" - device + "inode" - inode + "mode" - mode + "nlink" - number of hard + links + "uid" - user id + "gid" - group id + "device_type" - device type (if inode device) + "size" - total size in bytes + "blocksize" - blocksize + "blocks" - number of blocks + allocated + "atime" - time of last access + "mtime" - time of last modification + "ctime" - time of last change + + On error dio_stat returns NULL. @@ -121,7 +196,7 @@ dio_seek - Seek to pos on fd from whence + Seeks to pos on fd from whence Description @@ -134,7 +209,26 @@ - &warn.undocumented.func; + The function dio_seek is used to change the + file position of the file with descriptor + resource. + The parameter whence specifies how the + position pos should be interpreted: + + SEEK_SET - specifies that + pos is specified from the beginning of + the file + SEEK_CUR - Specifies that + pos is a count of characters from the + current file position. This count may be positive or negative + SEEK_END - Specifies that + pos is a count of characters from the + end of the file. A negative count specifies a position within + the current extent of the file; a positive count specifies a + position past the current end. If you set the position past the + current end, and actually write data, you will extend the file + with zeros up to that position + @@ -157,7 +251,17 @@ - &warn.undocumented.func; + The dio_fcntl function performs the + operation specified by cmd on the file + descriptor fd. Some commands require + additional arguments args to be supplied. + + + cmd can be one of the following + operations: + + + cmd parameters still undocumented. @@ -165,7 +269,7 @@ dio_close - Close the file descriptor given by fd + Closes the file descriptor given by fd Description @@ -176,7 +280,8 @@ - &warn.undocumented.func; + The function dio_close closes the + filedescriptor resource.