From 4ac3208782f932744f705f5423bc45aa76c3e86f Mon Sep 17 00:00:00 2001 From: Egon Schmid Date: Tue, 8 Jan 2002 22:39:37 +0000 Subject: [PATCH] Only whitespace. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@67336 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/dio.xml | 349 +++++++++++++++++++++++++++------------------- 1 file changed, 208 insertions(+), 141 deletions(-) diff --git a/functions/dio.xml b/functions/dio.xml index d5ffea8300..b73e492894 100644 --- a/functions/dio.xml +++ b/functions/dio.xml @@ -1,5 +1,5 @@ - + Direct IO functions DIO functions @@ -8,9 +8,9 @@
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,..). + 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,..).
@@ -25,47 +25,70 @@ dio_open - Opens 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 resource dio_open - string filename - int flags - int - mode - + string filename + int flags + int mode - 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 - + 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 - + 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 + + + @@ -73,25 +96,26 @@ dio_read - Reads n bytes from fd and returns them, if n is not specified, reads 1k block + + Reads n bytes from fd and returns them, if n is not specified, + reads 1k block + Description string dio_read - resource fd - int - n - + resource fd + int n - The function dio_read reads and returns + 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. + not specified, dio_read reads 1K sized block + and returns them. @@ -99,26 +123,26 @@ dio_write - Writes data to fd with optional truncation at length + + Writes data to fd with optional truncation at length + Description int dio_write - resource fd - string data - int - len + resource fd + string data + int len - The function dio_write - writes up to len bytes from - data to file fd. If - len is not specified, - dio_write writes all + 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. @@ -129,26 +153,28 @@ dio_truncate - Truncates file descriptor fd to offset bytes + + Truncates file descriptor fd to offset bytes + Description bool dio_truncate - resource fd - int offset + resource fd + int offset 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 + 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. @@ -156,39 +182,43 @@ dio_stat - Gets stat information about the file descriptor fd + + Gets stat information about the file descriptor fd + Description array dio_stat - resource fd + resource fd - 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. + 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. @@ -196,38 +226,49 @@ dio_seek - Seeks to pos on fd from whence + Seeks to pos on fd from whence Description int dio_seek - resource fd - int pos - int whence + resource fd + int pos + int whence 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: + 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 + + + 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 + + @@ -236,18 +277,16 @@ dio_fcntl - Performs a c library fcntl on fd + Performs a c library fcntl on fd Description mixed dio_fcntl - resource fd - int cmd - mixed - arg - + resource fd + int cmd + mixed arg @@ -257,40 +296,68 @@ additional arguments args to be supplied. - arg is an associative array, when - cmd is F_SETLK or F_SETLLW, with the - following keys: + arg is an associative array, when + cmd is F_SETLK or F_SETLLW, with the + following keys: - "start" - offset where lock begins - "length" - size of locked area. zero means to - end of file - "wenth" - Where l_start is relative to: can be - SEEK_SET, SEEK_END and SEEK_CUR - "type" - type of lock: can be F_RDLCK (read - lock), F_WRLCK (write lock) or F_UNLCK (unlock) + + + "start" - offset where lock begins + + + + + "length" - size of locked area. zero means to end of file + + + + + "wenth" - Where l_start is relative to: can be SEEK_SET, + SEEK_END and SEEK_CUR + + + + + "type" - type of lock: can be F_RDLCK (read lock), F_WRLCK + (write lock) or F_UNLCK (unlock) + + cmd can be one of the following operations: - - F_SETLK - Lock is set or cleared. If the lock + + + + F_SETLK - Lock is set or cleared. If the lock is held by someone else dio_fcntl returns - -1. - F_SETLKW - like F_SETLK, but in case the lock + -1. + + + + + F_SETLKW - like F_SETLK, but in case the lock is held by someone else, dio_fcntl waits - until the lock is released. - F_GETLK - dio_fcntl - returns an associative array (as described above) if someone - else prevents lock. If there is no obstruction key "type" - will set to F_UNLCK. - F_DUPFD - finds the lowest numbered available - file descriptor greater or equal than - arg and returns them. - - - - + until the lock is released. + + + + + F_GETLK - dio_fcntl returns an + associative array (as described above) if someone else + prevents lock. If there is no obstruction key "type" will set + to F_UNLCK. + + + + + F_DUPFD - finds the lowest numbered available file descriptor + greater or equal than arg and returns + them. + + + @@ -298,14 +365,14 @@ dio_close - Closes the file descriptor given by fd + Closes the file descriptor given by fd Description void dio_close - resource fd + resource fd