eschmid Tue Jan 8 17:39:37 2002 EDT Modified files: /phpdoc/en/functions dio.xml Log: Only whitespace.
Index: phpdoc/en/functions/dio.xml diff -u phpdoc/en/functions/dio.xml:1.6 phpdoc/en/functions/dio.xml:1.7 --- phpdoc/en/functions/dio.xml:1.6 Sat Jan 5 15:35:25 2002 +++ phpdoc/en/functions/dio.xml Tue Jan 8 17:39:37 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <reference id="ref.dio"> <title>Direct IO functions</title> <titleabbrev>DIO functions</titleabbrev> @@ -8,9 +8,9 @@ <section id="dio.intro"> <title>Direct I/O Functions</title> <para> - 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,..). </para> </section> <section id="dio.installation"> @@ -25,47 +25,70 @@ <refentry id="function.dio-open"> <refnamediv> <refname>dio_open</refname> - <refpurpose>Opens a new filename with specified permissions of flags and creation permissions of mode </refpurpose> + <refpurpose> + Opens a new filename with specified permissions of flags and + creation permissions of mode + </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>dio_open</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> - <paramdef>int <parameter>flags</parameter></paramdef> - <paramdef>int - <parameter><optional>mode</optional></parameter> - </paramdef> + <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>int <parameter>flags</parameter></paramdef> + <paramdef>int <parameter><optional>mode</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <function>dio_open</function> opens a file and returns a new - file descriptor for it, or -1 if any error occured. - If <parameter>flags</parameter> is O_CREAT, optional third parameter - <parameter>mode</parameter> will set the mode of the file - (creation permissions). - The <parameter>flags</parameter> parameter can be one of the - following options: - <itemizedlist> - <listitem><para>O_RDONLY - opens the file for read access</para></listitem> - <listitem><para>O_WRONLY - opens the file for write access</para></listitem> - <listitem><para>O_RDWR - opens the file for both reading and - writing</para></listitem> - </itemizedlist> + <function>dio_open</function> opens a file and returns a new file + descriptor for it, or -1 if any error occured. If + <parameter>flags</parameter> is O_CREAT, optional third parameter + <parameter>mode</parameter> will set the mode of the file + (creation permissions). The <parameter>flags</parameter> + parameter can be one of the following options: + <itemizedlist> + <listitem> + <para>O_RDONLY - opens the file for read access</para> + </listitem> + <listitem> + <para>O_WRONLY - opens the file for write access</para> + </listitem> + <listitem> + <para> + O_RDWR - opens the file for both reading and + writing + </para> + </listitem> + </itemizedlist> The <parameter>flags</parameter> parameter can also include any - combination of the following flags: - <itemizedlist> - <listitem><para>O_CREAT - creates the file, if it doesn't - already exist</para></listitem> - <listitem><para>O_EXCL - if both, O_CREAT and O_EXCL are set, - <function>dio_open</function> fails, if file already exists.</para></listitem> - <listitem><para>O_TRUNC - if file exists, and its opened - for write access, file will be truncated to zero length.</para></listitem> - <listitem><para>O_APPEND - write operations write data at the - end of file</para></listitem> - <listitem><para>O_NONBLOCK - sets non blocking mode</para></listitem> - </itemizedlist> + combination of the following flags: + <itemizedlist> + <listitem> + <para> + O_CREAT - creates the file, if it doesn't already exist + </para> + </listitem> + <listitem> + <para> + O_EXCL - if both, O_CREAT and O_EXCL are set, + <function>dio_open</function> fails, if file already exists + </para> + </listitem> + <listitem> + <para> + O_TRUNC - if file exists, and its opened for write access, + file will be truncated to zero length. + </para> + </listitem> + <listitem> + <para> + O_APPEND - write operations write data at the + end of file</para></listitem> <listitem><para>O_NONBLOCK - + sets non blocking mode + </para> + </listitem> + </itemizedlist> </para> </refsect1> </refentry> @@ -73,25 +96,26 @@ <refentry id="function.dio-read"> <refnamediv> <refname>dio_read</refname> - <refpurpose>Reads n bytes from fd and returns them, if n is not specified, reads 1k block</refpurpose> + <refpurpose> + Reads n bytes from fd and returns them, if n is not specified, + reads 1k block + </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>dio_read</function></funcdef> - <paramdef>resource <parameter>fd</parameter></paramdef> - <paramdef>int - <parameter><optional>n</optional></parameter> - </paramdef> + <paramdef>resource <parameter>fd</parameter></paramdef> + <paramdef>int <parameter><optional>n</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> - The function <function>dio_read</function> reads and returns + The function <function>dio_read</function> reads and returns <parameter>n</parameter> bytes from file with descriptor <parameter>resource</parameter>. If <parameter>n</parameter> is - not specified, <function>dio_read</function> reads 1K sized block and - returns them. + not specified, <function>dio_read</function> reads 1K sized block + and returns them. </para> </refsect1> </refentry> @@ -99,26 +123,26 @@ <refentry id="function.dio-write"> <refnamediv> <refname>dio_write</refname> - <refpurpose>Writes data to fd with optional truncation at length </refpurpose> + <refpurpose> + Writes data to fd with optional truncation at length + </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dio_write</function></funcdef> - <paramdef>resource <parameter>fd</parameter></paramdef> - <paramdef>string <parameter>data</parameter></paramdef> - <paramdef>int - <parameter><optional>len</optional></parameter> + <paramdef>resource <parameter>fd</parameter></paramdef> + <paramdef>string <parameter>data</parameter></paramdef> + <paramdef>int <parameter><optional>len</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> - The function <function>dio_write</function> - writes up to <parameter>len</parameter> bytes from - <parameter>data</parameter> to file <parameter>fd</parameter>. If - <parameter>len</parameter> is not specified, - <function>dio_write</function> writes all + The function <function>dio_write</function> writes up to + <parameter>len</parameter> bytes from <parameter>data</parameter> + to file <parameter>fd</parameter>. If <parameter>len</parameter> + is not specified, <function>dio_write</function> writes all <parameter>data</parameter> to the specified file. <function>dio_write</function> returns the number of bytes written to <parameter>fd</parameter>. @@ -129,26 +153,28 @@ <refentry id="function.dio-truncate"> <refnamediv> <refname>dio_truncate</refname> - <refpurpose>Truncates file descriptor fd to offset bytes </refpurpose> + <refpurpose> + Truncates file descriptor fd to offset bytes + </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>dio_truncate</function></funcdef> - <paramdef>resource <parameter>fd</parameter></paramdef> - <paramdef>int <parameter>offset</parameter></paramdef> + <paramdef>resource <parameter>fd</parameter></paramdef> + <paramdef>int <parameter>offset</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Function <function>dio_truncate</function> causes the file - referenced by <parameter>fd</parameter> to be truncated to at - most <parameter>offset</parameter> 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 <parameter>fd</parameter> to be truncated to at + most <parameter>offset</parameter> 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. </para> </refsect1> </refentry> @@ -156,39 +182,43 @@ <refentry id="function.dio-stat"> <refnamediv> <refname>dio_stat</refname> - <refpurpose>Gets stat information about the file descriptor fd </refpurpose> + <refpurpose> + Gets stat information about the file descriptor fd + </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>dio_stat</function></funcdef> - <paramdef>resource <parameter>fd</parameter></paramdef> + <paramdef>resource <parameter>fd</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Function <function>fstat</function> returns information about - the file with file descriptor - <parameter>fd</parameter>. <function>dio_stat</function> returns - an associative array with the following keys: - <itemizedlist> - <listitem><para>"device" - device</para></listitem> - <listitem><para>"inode" - inode</para></listitem> - <listitem><para>"mode" - mode</para></listitem> - <listitem><para>"nlink" - number of hard - links</para></listitem> - <listitem><para>"uid" - user id</para></listitem> - <listitem><para>"gid" - group id</para></listitem> - <listitem><para>"device_type" - device type (if inode device)</para></listitem> - <listitem><para>"size" - total size in bytes</para></listitem> - <listitem><para>"blocksize" - blocksize</para></listitem> - <listitem><para>"blocks" - number of blocks - allocated</para></listitem> - <listitem><para>"atime" - time of last access</para></listitem> - <listitem><para>"mtime" - time of last modification</para></listitem> - <listitem><para>"ctime" - time of last change</para></listitem> - </itemizedlist> - On error <function>dio_stat</function> returns NULL. + Function <function>fstat</function> returns information about the + file with file descriptor + <parameter>fd</parameter>. <function>dio_stat</function> returns + an associative array with the following keys: + <itemizedlist> + <listitem><para>"device" - device</para></listitem> + <listitem><para>"inode" - inode</para></listitem> + <listitem><para>"mode" - mode</para></listitem> + <listitem><para>"nlink" - number of hard links</para></listitem> + <listitem><para>"uid" - user id</para></listitem> + <listitem><para>"gid" - group id</para></listitem> + <listitem> + <para> + "device_type" - device type (if inode device) + </para> + </listitem> + <listitem><para>"size" - total size in bytes</para></listitem> + <listitem><para>"blocksize" - blocksize</para></listitem> + <listitem><para>"blocks" - number of blocks allocated</para></listitem> + <listitem><para>"atime" - time of last access</para></listitem> + <listitem><para>"mtime" - time of last modification</para></listitem> + <listitem><para>"ctime" - time of last change</para></listitem> + </itemizedlist> + On error <function>dio_stat</function> returns NULL. </para> </refsect1> </refentry> @@ -196,38 +226,49 @@ <refentry id="function.dio-seek"> <refnamediv> <refname>dio_seek</refname> - <refpurpose>Seeks to pos on fd from whence </refpurpose> + <refpurpose>Seeks to pos on fd from whence</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dio_seek</function></funcdef> - <paramdef>resource <parameter>fd</parameter></paramdef> - <paramdef>int <parameter>pos</parameter></paramdef> - <paramdef>int <parameter>whence</parameter></paramdef> + <paramdef>resource <parameter>fd</parameter></paramdef> + <paramdef>int <parameter>pos</parameter></paramdef> + <paramdef>int <parameter>whence</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function <function>dio_seek</function> is used to change the file position of the file with descriptor - <parameter>resource</parameter>. - The parameter <parameter>whence</parameter> specifies how the - position <parameter>pos</parameter> should be interpreted: + <parameter>resource</parameter>. The parameter + <parameter>whence</parameter> specifies how the position + <parameter>pos</parameter> should be interpreted: <itemizedlist> - <listitem><para>SEEK_SET - specifies that - <parameter>pos</parameter> is specified from the beginning of - the file</para></listitem> - <listitem><para>SEEK_CUR - Specifies that - <parameter>pos</parameter> is a count of characters from the - current file position. This count may be positive or negative</para></listitem> - <listitem><para>SEEK_END - Specifies that - <parameter>pos</parameter> 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</para></listitem> + <listitem> + <para> + SEEK_SET - specifies that <parameter>pos</parameter> is + specified from the beginning of the file + </para> + </listitem> + <listitem> + <para> + SEEK_CUR - Specifies that <parameter>pos</parameter> is a + count of characters from the current file position. This count + may be positive or negative + </para> + </listitem> + <listitem> + <para> + SEEK_END - Specifies that <parameter>pos</parameter> 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 + </para> + </listitem> </itemizedlist> </para> </refsect1> @@ -236,18 +277,16 @@ <refentry id="function.dio-fcntl"> <refnamediv> <refname>dio_fcntl</refname> - <refpurpose>Performs a c library fcntl on fd </refpurpose> + <refpurpose>Performs a c library fcntl on fd</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>dio_fcntl</function></funcdef> - <paramdef>resource <parameter>fd</parameter></paramdef> - <paramdef>int <parameter>cmd</parameter></paramdef> - <paramdef>mixed - <parameter><optional>arg</optional></parameter> - </paramdef> + <paramdef>resource <parameter>fd</parameter></paramdef> + <paramdef>int <parameter>cmd</parameter></paramdef> + <paramdef>mixed <parameter><optional>arg</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -257,40 +296,68 @@ additional arguments <parameter>args</parameter> to be supplied. </para> <para> - <parameter>arg</parameter> is an associative array, when - <parameter>cmd</parameter> is F_SETLK or F_SETLLW, with the - following keys: + <parameter>arg</parameter> is an associative array, when + <parameter>cmd</parameter> is F_SETLK or F_SETLLW, with the + following keys: <itemizedlist> - <listitem><para>"start" - offset where lock begins</para></listitem> - <listitem><para>"length" - size of locked area. zero means to - end of file</para></listitem> - <listitem><para>"wenth" - Where l_start is relative to: can be - SEEK_SET, SEEK_END and SEEK_CUR</para></listitem> - <listitem><para>"type" - type of lock: can be F_RDLCK (read - lock), F_WRLCK (write lock) or F_UNLCK (unlock)</para></listitem> + <listitem> + <para> + "start" - offset where lock begins + </para> + </listitem> + <listitem> + <para> + "length" - size of locked area. zero means to end of file + </para> + </listitem> + <listitem> + <para> + "wenth" - Where l_start is relative to: can be SEEK_SET, + SEEK_END and SEEK_CUR + </para> + </listitem> + <listitem> + <para> + "type" - type of lock: can be F_RDLCK (read lock), F_WRLCK + (write lock) or F_UNLCK (unlock) + </para> + </listitem> </itemizedlist> </para> <para> <parameter>cmd</parameter> can be one of the following operations: - <itemizedlist> - <listitem><para>F_SETLK - Lock is set or cleared. If the lock + <itemizedlist> + <listitem> + <para> + F_SETLK - Lock is set or cleared. If the lock is held by someone else <function>dio_fcntl</function> returns - -1.</para></listitem> - <listitem><para>F_SETLKW - like F_SETLK, but in case the lock + -1. + </para> + </listitem> + <listitem> + <para> + F_SETLKW - like F_SETLK, but in case the lock is held by someone else, <function>dio_fcntl</function> waits - until the lock is released.</para></listitem> - <listitem><para>F_GETLK - <function>dio_fcntl</function> - returns an associative array (as described above) if someone - else prevents lock. If there is no obstruction key "type" - will set to F_UNLCK.</para></listitem> - <listitem><para>F_DUPFD - finds the lowest numbered available - file descriptor greater or equal than - <parameter>arg</parameter> and returns them.</para></listitem> - </itemizedlist> - </para> - <para> - + until the lock is released. + </para> + </listitem> + <listitem> + <para> + F_GETLK - <function>dio_fcntl</function> returns an + associative array (as described above) if someone else + prevents lock. If there is no obstruction key "type" will set + to F_UNLCK. + </para> + </listitem> + <listitem> + <para> + F_DUPFD - finds the lowest numbered available file descriptor + greater or equal than <parameter>arg</parameter> and returns + them. + </para> + </listitem> + </itemizedlist> </para> </refsect1> </refentry> @@ -298,14 +365,14 @@ <refentry id="function.dio-close"> <refnamediv> <refname>dio_close</refname> - <refpurpose>Closes the file descriptor given by fd </refpurpose> + <refpurpose>Closes the file descriptor given by fd</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>dio_close</function></funcdef> - <paramdef>resource <parameter>fd</parameter></paramdef> + <paramdef>resource <parameter>fd</parameter></paramdef> </funcprototype> </funcsynopsis> <para>