mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
W/S, Tab removal
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@318019 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
7992a39701
commit
c21644b453
53 changed files with 544 additions and 554 deletions
|
@ -28,7 +28,7 @@
|
|||
<example>
|
||||
<title>Incorrect requests</title>
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
// Request to create symlink of $filename to $link
|
||||
eio_symlink($filename, $link);
|
||||
|
||||
|
@ -47,7 +47,7 @@ eio_event_loop();
|
|||
<example>
|
||||
<title>Calling request from a request callback</title>
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
function my_symlink_done($filename, $result) {
|
||||
// Request to move $filename to $new_filename
|
||||
eio_rename($filename, "/path/to/new-name");
|
||||
|
@ -69,7 +69,7 @@ eio_event_loop();
|
|||
<example>
|
||||
<title>Calling request from a request callback</title>
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
/* Is called when the group requests are done */
|
||||
function my_grp_done($data, $result) {
|
||||
// ...
|
||||
|
@ -87,7 +87,7 @@ $grp = eio_grp("my_grp_done", "my_grp_data");
|
|||
|
||||
// Create eio_symlink request and add it to the group
|
||||
// Pass $filename to the callback
|
||||
$req = eio_symlink($filename, $link,
|
||||
$req = eio_symlink($filename, $link,
|
||||
EIO_PRI_DEFAULT, "my_symlink_done", $filename);
|
||||
eio_grp_add($grp, $req);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
more verbose.</para>
|
||||
|
||||
<para><option role="configure">--with-eio-shm-key</option>
|
||||
option sets shared memory segment key. Default: /tmp/php-eio-shm
|
||||
option sets shared memory segment key. Default: /tmp/php-eio-shm
|
||||
</para>
|
||||
|
||||
<para><option role="configure">--with-eio-shm-prm</option>
|
||||
|
@ -26,7 +26,7 @@
|
|||
Semaphores are currently used in internal event loop implementation. The only
|
||||
thing to note is to provide unique ID for the semaphore key and sufficient
|
||||
priveleges to that. If you are not sure what these settings mean, just leave
|
||||
their defaults.
|
||||
their defaults.
|
||||
</para>
|
||||
|
||||
<warning><simpara>Be sure that you gave read
|
||||
|
|
|
@ -44,13 +44,13 @@
|
|||
<!--}}}-->
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
</para>
|
||||
<para>
|
||||
Flags used with <function>eio_readdir</function>:
|
||||
<variablelist>
|
||||
|
||||
<!--{{{ EIO_READDIR_* -->
|
||||
<varlistentry>
|
||||
<!--{{{ EIO_READDIR_* -->
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_READDIR_DENTS</constant>
|
||||
(<type>integer</type>)
|
||||
|
@ -59,19 +59,14 @@
|
|||
<simpara>
|
||||
<function>eio_readdir</function> flag. If specified, the result argument of the callback
|
||||
becomes an array with the following keys:
|
||||
|
||||
<literal>'names'</literal> - array of directory names
|
||||
|
||||
<literal>'dents'</literal> - array of <literal>struct
|
||||
eio_dirent</literal>-like arrays having the following keys each:
|
||||
|
||||
<literal>'name'</literal> - the directory name;
|
||||
|
||||
<literal>'type'</literal> - one of <emphasis>EIO_DT_*</emphasis>
|
||||
constants;
|
||||
|
||||
<literal>'inode'</literal> - the inode number, if available, otherwise
|
||||
unspecified;
|
||||
<literal>'names'</literal> - array of directory names
|
||||
<literal>'dents'</literal> - array of <literal>struct eio_dirent</literal>-like
|
||||
arrays having the following keys each:
|
||||
<literal>'name'</literal> - the directory name;
|
||||
<literal>'type'</literal> - one of <emphasis>EIO_DT_*</emphasis>
|
||||
constants;
|
||||
<literal>'inode'</literal> - the inode number, if available, otherwise
|
||||
unspecified;
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -83,7 +78,7 @@
|
|||
<listitem>
|
||||
<simpara>
|
||||
When this flag is specified, the names will be returned in an order
|
||||
where likely directories come first, in optimal stat order.
|
||||
where likely directories come first, in optimal stat order.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -123,7 +118,7 @@
|
|||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Unknown node type(very common). Further <function>stat</function> needed.
|
||||
Unknown node type(very common). Further <function>stat</function> needed.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -167,7 +162,7 @@
|
|||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Directory node type
|
||||
Directory node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -295,8 +290,8 @@
|
|||
<!--}}}-->
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
</para>
|
||||
<para>
|
||||
Access modes for <function>eio_open</function> <parameter>flags</parameter>
|
||||
argument:
|
||||
<variablelist>
|
||||
|
@ -395,8 +390,8 @@
|
|||
<!--}}}-->
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
</para>
|
||||
<para>
|
||||
<parameter>mode</parameter> argument flags for <function>eio_open</function>:
|
||||
<variablelist>
|
||||
|
||||
|
@ -545,8 +540,8 @@
|
|||
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
</para>
|
||||
<para>
|
||||
<function>eio_sync_file_range</function> flags:
|
||||
<variablelist>
|
||||
|
||||
|
@ -585,8 +580,8 @@
|
|||
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
</para>
|
||||
<para>
|
||||
<function>eio_fallocate</function> flags:
|
||||
<variablelist>
|
||||
|
||||
|
@ -611,19 +606,19 @@
|
|||
</para>
|
||||
</note>
|
||||
|
||||
<note xmlns="http://docbook.org/ns/docbook">
|
||||
<para>
|
||||
<emphasis>EIO_SYNC_FILE_*</emphasis> constants have the same meaning as their
|
||||
<emphasis>SYNC_FILE_**</emphasis> counterparts.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<note xmlns="http://docbook.org/ns/docbook">
|
||||
<para>
|
||||
<emphasis>EIO_O_*</emphasis> constants have the same meaning as their
|
||||
<emphasis>O_*</emphasis> POSIX counterparts.
|
||||
</para>
|
||||
</note>
|
||||
<note xmlns="http://docbook.org/ns/docbook">
|
||||
<para>
|
||||
<emphasis>EIO_SYNC_FILE_*</emphasis> constants have the same meaning as their
|
||||
<emphasis>SYNC_FILE_**</emphasis> counterparts.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<note xmlns="http://docbook.org/ns/docbook">
|
||||
<para>
|
||||
<emphasis>EIO_O_*</emphasis> constants have the same meaning as their
|
||||
<emphasis>O_*</emphasis> POSIX counterparts.
|
||||
</para>
|
||||
</note>
|
||||
</appendix>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@ -643,6 +638,6 @@ sgml-local-catalogs:nil
|
|||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
|
|
@ -22,7 +22,7 @@ eio_cancel($req);
|
|||
// This time eio_nop() will be processed
|
||||
eio_nop(EIO_PRI_DEFAULT, "my_nop_cb", "2");
|
||||
|
||||
// Process requests
|
||||
// Process requests
|
||||
eio_event_loop();
|
||||
?>
|
||||
]]>
|
||||
|
@ -42,19 +42,19 @@ my_nop 2
|
|||
<title>Calling <function>eio_chmod</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
$temp_filename = "eio-temp-file.tmp";
|
||||
touch($temp_filename);
|
||||
|
||||
/* Is called when eio_chmod() finished */
|
||||
function my_chmod_callback($data, $result) {
|
||||
global $temp_filename;
|
||||
global $temp_filename;
|
||||
|
||||
if ($result == 0 && !is_readable($temp_filename) && is_writable($temp_filename)) {
|
||||
echo "eio_chmod_ok";
|
||||
}
|
||||
if ($result == 0 && !is_readable($temp_filename) && is_writable($temp_filename)) {
|
||||
echo "eio_chmod_ok";
|
||||
}
|
||||
|
||||
@unlink($temp_filename);
|
||||
@unlink($temp_filename);
|
||||
}
|
||||
|
||||
eio_chmod($temp_filename, 0200, EIO_PRI_DEFAULT, "my_chmod_callback");
|
||||
|
@ -76,25 +76,25 @@ eio_chmod_ok
|
|||
<title>Making a custom request</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
/* Callback for the custom callback */
|
||||
function my_custom_callback($data, $result) {
|
||||
var_dump($data);
|
||||
var_dump(count($result));
|
||||
var_dump($result['data_modified']);
|
||||
var_dump($result['result']);
|
||||
var_dump($data);
|
||||
var_dump(count($result));
|
||||
var_dump($result['data_modified']);
|
||||
var_dump($result['result']);
|
||||
}
|
||||
|
||||
/* The custom request */
|
||||
function my_custom($data) {
|
||||
var_dump($data);
|
||||
var_dump($data);
|
||||
|
||||
$result = array(
|
||||
'result' => 1001,
|
||||
'data_modified' => "my custom data",
|
||||
);
|
||||
$result = array(
|
||||
'result' => 1001,
|
||||
'data_modified' => "my custom data",
|
||||
);
|
||||
|
||||
return $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
$data = "my_custom_data";
|
||||
|
@ -123,7 +123,7 @@ int(1001)
|
|||
<title>Grouping requests</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
/*
|
||||
* Create a group request to open, read and close a file
|
||||
*/
|
||||
|
@ -136,7 +136,7 @@ fclose($fp);
|
|||
/* Is called when the group requests are done */
|
||||
function my_grp_done($data, $result) {
|
||||
global $temp_filename;
|
||||
var_dump($result == 0);
|
||||
var_dump($result == 0);
|
||||
@unlink($temp_filename);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<term><parameter>delay</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Delay in seconds
|
||||
Delay in seconds
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -56,7 +56,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<term><parameter>req</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The request resource
|
||||
The request resource
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -46,7 +46,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -80,7 +80,7 @@ eio_cancel($req);
|
|||
// This time eio_nop() will be processed
|
||||
eio_nop(EIO_PRI_DEFAULT, "my_nop_cb", "2");
|
||||
|
||||
// Process requests
|
||||
// Process requests
|
||||
eio_event_loop();
|
||||
?>
|
||||
]]>
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
choice="opt"><type>mixed</type><parameter>data</parameter><initializer>NULL</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Changes file, or directory permissions.
|
||||
Changes file, or directory permissions.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Path to file or directory.
|
||||
Path to file or directory.
|
||||
&eio.warn.relpath;
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
</para>
|
||||
|
||||
<warning xmlns="http://docbook.org/ns/docbook"><simpara>May crash with
|
||||
<emphasis>xdebug</emphasis> extension. See issue
|
||||
<emphasis>xdebug</emphasis> extension. See issue
|
||||
<link xlink:href="http://bugs.xdebug.org/view.php?id=725">http://bugs.xdebug.org/view.php?id=725</link>
|
||||
</simpara></warning>
|
||||
|
||||
|
@ -41,16 +41,16 @@
|
|||
<programlisting role="php"><![CDATA[
|
||||
mixed execute(mixed data);
|
||||
]]></programlisting>
|
||||
<parameter>callback</parameter> is event completion callback that should match the following
|
||||
<parameter>callback</parameter> is event completion callback that should match the following
|
||||
prototype:
|
||||
<programlisting role="php"><![CDATA[
|
||||
void callback(mixed data, mixed result);
|
||||
]]></programlisting>
|
||||
|
||||
<parameter>data</parameter> is the data passed to
|
||||
<parameter>data</parameter> is the data passed to
|
||||
<parameter>execute</parameter> via <parameter>data</parameter> argument
|
||||
without modifications
|
||||
<parameter>result</parameter> value returned by <parameter>execute</parameter>
|
||||
<parameter>result</parameter> value returned by <parameter>execute</parameter>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -70,7 +70,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -84,7 +84,7 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
|
@ -92,25 +92,25 @@
|
|||
<title><function>eio_custom</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
/* Callback for the custom callback */
|
||||
function my_custom_callback($data, $result) {
|
||||
var_dump($data);
|
||||
var_dump(count($result));
|
||||
var_dump($result['data_modified']);
|
||||
var_dump($result['result']);
|
||||
var_dump($data);
|
||||
var_dump(count($result));
|
||||
var_dump($result['data_modified']);
|
||||
var_dump($result['result']);
|
||||
}
|
||||
|
||||
/* The custom request */
|
||||
function my_custom($data) {
|
||||
var_dump($data);
|
||||
var_dump($data);
|
||||
|
||||
$result = array(
|
||||
'result' => 1001,
|
||||
'data_modified' => "my custom data",
|
||||
);
|
||||
$result = array(
|
||||
'result' => 1001,
|
||||
'data_modified' => "my custom data",
|
||||
);
|
||||
|
||||
return $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
$data = "my_custom_data";
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<term><parameter>fd</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Source file descriptor
|
||||
Source file descriptor
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<term><parameter>fd2</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Target file descriptor
|
||||
Target file descriptor
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -62,7 +62,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -37,19 +37,19 @@
|
|||
<title><function>eio_event_loop</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
$temp_filename = "eio-temp-file.tmp";
|
||||
touch($temp_filename);
|
||||
|
||||
/* Is called when eio_chmod() finished */
|
||||
function my_chmod_callback($data, $result) {
|
||||
global $temp_filename;
|
||||
global $temp_filename;
|
||||
|
||||
if ($result == 0 && !is_readable($temp_filename) && is_writable($temp_filename)) {
|
||||
echo "eio_chmod_ok";
|
||||
}
|
||||
if ($result == 0 && !is_readable($temp_filename) && is_writable($temp_filename)) {
|
||||
echo "eio_chmod_ok";
|
||||
}
|
||||
|
||||
@unlink($temp_filename);
|
||||
@unlink($temp_filename);
|
||||
}
|
||||
|
||||
eio_chmod($temp_filename, 0200, EIO_PRI_DEFAULT, "my_chmod_callback");
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<listitem>
|
||||
<para>Currently only one flag is supported for mode:
|
||||
<constant>EIO_FALLOC_FL_KEEP_SIZE</constant> (the same as POSIX constant
|
||||
<constant>FALLOC_FL_KEEP_SIZE</constant>).
|
||||
<constant>FALLOC_FL_KEEP_SIZE</constant>).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -94,7 +94,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<term><parameter>fd</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The file descriptor.
|
||||
The file descriptor.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -70,7 +70,7 @@
|
|||
<title><function>eio_lstat</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
// Create temporary file
|
||||
$tmp_filename = dirname(__FILE__) ."/eio-file.tmp";
|
||||
touch($tmp_filename);
|
||||
|
@ -78,11 +78,11 @@ touch($tmp_filename);
|
|||
/* Is called when eio_fstat() done */
|
||||
function my_res_cb($data, $result) {
|
||||
// Should output array with stat info
|
||||
var_dump($result);
|
||||
var_dump($result);
|
||||
|
||||
if ($data['fd']) {
|
||||
// Close temporary file
|
||||
eio_close($data['fd']);
|
||||
eio_close($data['fd']);
|
||||
eio_event_loop();
|
||||
}
|
||||
// Remove temporary file
|
||||
|
@ -91,7 +91,7 @@ function my_res_cb($data, $result) {
|
|||
|
||||
/* Is called when eio_open() done */
|
||||
function my_open_cb($data, $result) {
|
||||
// Prepare data for callback
|
||||
// Prepare data for callback
|
||||
$d = array(
|
||||
'fd' => $result,
|
||||
'file'=> $data
|
||||
|
@ -103,7 +103,7 @@ function my_open_cb($data, $result) {
|
|||
}
|
||||
|
||||
// Open temporary file
|
||||
eio_open($tmp_filename, EIO_O_RDONLY, NULL, EIO_PRI_DEFAULT,
|
||||
eio_open($tmp_filename, EIO_O_RDONLY, NULL, EIO_PRI_DEFAULT,
|
||||
"my_open_cb", $tmp_filename);
|
||||
eio_event_loop();
|
||||
?>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<term><parameter>fd</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A file descriptor of a file within the mounted file system.
|
||||
A file descriptor of a file within the mounted file system.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -50,7 +50,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<term><parameter>fd</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The file descriptor, e.g. returned by <function>eio_open</function>
|
||||
The file descriptor, e.g. returned by <function>eio_open</function>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -44,7 +44,7 @@
|
|||
<term><parameter>atime</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Access time
|
||||
Access time
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -72,7 +72,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<example>
|
||||
<title>Grouping requests</title>
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
/*
|
||||
* Create a group request to open, read and close a file
|
||||
*/
|
||||
|
@ -67,7 +67,7 @@ fclose($fp);
|
|||
|
||||
/* Is called when the group requests are done */
|
||||
function my_grp_done($data, $result) {
|
||||
var_dump($result == 0);
|
||||
var_dump($result == 0);
|
||||
@unlink($data);
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ function my_grp_file_opened_callback($data, $result) {
|
|||
|
||||
// Create eio_read() request and add it to the group
|
||||
// Pass file descriptor to the callback
|
||||
$req = eio_read($result, 4, 0,
|
||||
$req = eio_read($result, 4, 0,
|
||||
EIO_PRI_DEFAULT, "my_grp_file_read_callback", $result);
|
||||
eio_grp_add($grp, $req);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<term><parameter>limit</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Number of requests in the group.
|
||||
Number of requests in the group.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<title><function>eio_grp</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
$temp_filename = dirname(__FILE__) ."/eio-file.tmp";
|
||||
$fp = fopen($temp_filename, "w");
|
||||
fwrite($fp, "some data");
|
||||
|
@ -73,7 +73,7 @@ function my_grp_file_opened_callback($data, $result) {
|
|||
|
||||
$my_file_fd = $result;
|
||||
|
||||
$req = eio_read($my_file_fd, 4, 0,
|
||||
$req = eio_read($my_file_fd, 4, 0,
|
||||
EIO_PRI_DEFAULT, "my_grp_file_read_callback");
|
||||
eio_grp_add($grp, $req);
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ function my_grp_file_read_callback($data, $result) {
|
|||
$grp = eio_grp("my_grp_done", $temp_filename);
|
||||
|
||||
// Create request
|
||||
$req = eio_open($temp_filename, EIO_O_RDWR | EIO_O_APPEND , NULL,
|
||||
$req = eio_open($temp_filename, EIO_O_RDWR | EIO_O_APPEND , NULL,
|
||||
EIO_PRI_DEFAULT, "my_grp_file_opened_callback", NULL);
|
||||
|
||||
// Add request to the group
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -83,36 +83,36 @@
|
|||
<title><function>eio_link</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
$filename = dirname(__FILE__)."/symlink.dat";
|
||||
touch($filename);
|
||||
$link = dirname(__FILE__)."/symlink.link";
|
||||
$hardlink = dirname(__FILE__)."/hardlink.link";
|
||||
|
||||
function my_hardlink_cb($data, $result) {
|
||||
global $link, $filename;
|
||||
var_dump(file_exists($data) && !is_link($data));
|
||||
@unlink($data);
|
||||
global $link, $filename;
|
||||
var_dump(file_exists($data) && !is_link($data));
|
||||
@unlink($data);
|
||||
|
||||
eio_symlink($filename, $link, EIO_PRI_DEFAULT, "my_symlink_cb", $link);
|
||||
eio_symlink($filename, $link, EIO_PRI_DEFAULT, "my_symlink_cb", $link);
|
||||
}
|
||||
|
||||
function my_symlink_cb($data, $result) {
|
||||
global $link, $filename;
|
||||
var_dump(file_exists($data) && is_link($data));
|
||||
global $link, $filename;
|
||||
var_dump(file_exists($data) && is_link($data));
|
||||
|
||||
if (!eio_readlink($data, EIO_PRI_DEFAULT, "my_readlink_cb", NULL)) {
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
}
|
||||
if (!eio_readlink($data, EIO_PRI_DEFAULT, "my_readlink_cb", NULL)) {
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
}
|
||||
}
|
||||
|
||||
function my_readlink_cb($data, $result) {
|
||||
global $filename, $link;
|
||||
var_dump($result);
|
||||
global $filename, $link;
|
||||
var_dump($result);
|
||||
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
}
|
||||
|
||||
eio_link($filename, $hardlink, EIO_PRI_DEFAULT, "my_hardlink_cb", $hardlink);
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -71,24 +71,24 @@
|
|||
<title><function>eio_lstat</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
$tmp_filename = dirname(__FILE__). "/eio-file.tmp";
|
||||
touch($tmp_filename);
|
||||
|
||||
function my_res_cb($data, $result) {
|
||||
var_dump($data);
|
||||
var_dump($result);
|
||||
var_dump($data);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function my_open_cb($data, $result) {
|
||||
eio_close($result);
|
||||
eio_event_loop();
|
||||
eio_close($result);
|
||||
eio_event_loop();
|
||||
|
||||
@unlink($data);
|
||||
@unlink($data);
|
||||
}
|
||||
|
||||
eio_lstat($tmp_filename, EIO_PRI_DEFAULT, "my_res_cb", "eio_lstat");
|
||||
eio_open($tmp_filename, EIO_O_RDONLY, NULL,
|
||||
eio_open($tmp_filename, EIO_O_RDONLY, NULL,
|
||||
EIO_PRI_DEFAULT, "my_open_cb", $tmp_filename);
|
||||
eio_event_loop();
|
||||
?>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Path for the new directory.
|
||||
Path for the new directory.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<term><parameter>mode</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Access mode, e.g. 0755
|
||||
Access mode, e.g. 0755
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -62,7 +62,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -82,20 +82,20 @@
|
|||
<title><function>eio_mkdir</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
$temp_dirname = "eio-temp-dir";
|
||||
|
||||
/* Is called when eio_mkdir() finishes */
|
||||
function my_mkdir_callback($data, $result) {
|
||||
if ($result == 0 && is_dir($temp_dirname)
|
||||
if ($result == 0 && is_dir($temp_dirname)
|
||||
&& !is_readable($temp_dirname)
|
||||
&& is_writable($temp_dirname)) {
|
||||
echo "eio_mkdir_ok";
|
||||
}
|
||||
|
||||
// Remove directory
|
||||
if (file_exists($data))
|
||||
rmdir($temp_dirname);
|
||||
if (file_exists($data))
|
||||
rmdir($temp_dirname);
|
||||
}
|
||||
|
||||
// Create directory with access mode 0300
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Path for the new node(file).
|
||||
Path for the new node(file).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -88,7 +88,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -109,24 +109,24 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
|
||||
<?php
|
||||
<?php
|
||||
// FIFO name
|
||||
$temp_filename = "/tmp/eio-temp-fifo";
|
||||
|
||||
/* Is called when eio_mknod() finishes */
|
||||
function my_mknod_callback($data, $result) {
|
||||
$s = stat($data);
|
||||
var_dump($s);
|
||||
$s = stat($data);
|
||||
var_dump($s);
|
||||
|
||||
if ($result == 0) {
|
||||
echo "eio_mknod_ok";
|
||||
}
|
||||
if ($result == 0) {
|
||||
echo "eio_mknod_ok";
|
||||
}
|
||||
|
||||
@unlink($data);
|
||||
@unlink($data);
|
||||
}
|
||||
|
||||
eio_mknod($temp_filename, EIO_S_IFIFO, 0,
|
||||
EIO_PRI_DEFAULT, "my_mknod_callback", $temp_filename);
|
||||
eio_mknod($temp_filename, EIO_S_IFIFO, 0,
|
||||
EIO_PRI_DEFAULT, "my_mknod_callback", $temp_filename);
|
||||
eio_event_loop();
|
||||
?>
|
||||
]]>
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
||||
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
|
|
@ -40,8 +40,8 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
function res_cb($data, $result) {
|
||||
var_dump($data);
|
||||
var_dump($result);
|
||||
var_dump($data);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
eio_nop(EIO_PRI_DEFAULT, "res_cb", "1");
|
||||
|
@ -49,7 +49,7 @@ eio_nop(EIO_PRI_DEFAULT, "res_cb", "2");
|
|||
eio_nop(EIO_PRI_DEFAULT, "res_cb", "3");
|
||||
|
||||
while (eio_nreqs()) {
|
||||
eio_poll();
|
||||
eio_poll();
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</methodsynopsis>
|
||||
<para>
|
||||
<function>eio_open</function> opens file specified by
|
||||
<parameter>path</parameter> in access mode <parameter>mode</parameter> with
|
||||
<parameter>path</parameter> in access mode <parameter>mode</parameter> with
|
||||
</para>
|
||||
|
||||
|
||||
|
@ -34,11 +34,11 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Path of the file to be opened.
|
||||
Path of the file to be opened.
|
||||
<warning><simpara>
|
||||
In some SAPIs(e.g. <emphasis>PHP-FPM</emphasis>) it could fail, if you
|
||||
don't specify full path.
|
||||
</simpara></warning>
|
||||
</simpara></warning>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -80,7 +80,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -102,26 +102,26 @@
|
|||
<title><function>eio_open</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
$temp_filename = "eio-temp-file.tmp";
|
||||
|
||||
/* Is called when eio_close() finishes */
|
||||
function my_close_cb($data, $result) {
|
||||
// Zero indicates success
|
||||
var_dump($result == 0);
|
||||
// Zero indicates success
|
||||
var_dump($result == 0);
|
||||
@unlink($data);
|
||||
}
|
||||
|
||||
/* Is called when eio_open() finishes */
|
||||
function my_file_opened_callback($data, $result) {
|
||||
// $result should contain the file descriptor
|
||||
var_dump($result > 0);
|
||||
// $result should contain the file descriptor
|
||||
var_dump($result > 0);
|
||||
|
||||
if ($result > 0) {
|
||||
if ($result > 0) {
|
||||
// Close the file
|
||||
eio_close($result, EIO_PRI_DEFAULT, "my_close_cb", $data);
|
||||
eio_event_loop();
|
||||
}
|
||||
eio_close($result, EIO_PRI_DEFAULT, "my_close_cb", $data);
|
||||
eio_event_loop();
|
||||
}
|
||||
}
|
||||
|
||||
// Create new file for reading and writing
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
function res_cb($data, $result) {
|
||||
var_dump($data);
|
||||
var_dump($result);
|
||||
var_dump($data);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
eio_nop(EIO_PRI_DEFAULT, "res_cb", "1");
|
||||
|
@ -53,7 +53,7 @@ eio_nop(EIO_PRI_DEFAULT, "res_cb", "2");
|
|||
eio_nop(EIO_PRI_DEFAULT, "res_cb", "3");
|
||||
|
||||
while (eio_nreqs()) {
|
||||
eio_poll();
|
||||
eio_poll();
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<term><parameter>offset</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Offset within the file.
|
||||
Offset within the file.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -93,7 +93,7 @@
|
|||
<title><function>eio_read</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
// Open a temporary file and write some bytes there
|
||||
$temp_filename = "eio-temp-file.tmp";
|
||||
$fp = fopen($temp_filename, "w");
|
||||
|
@ -102,35 +102,35 @@ fclose($fp);
|
|||
|
||||
/* Is called when eio_read() is done */
|
||||
function my_read_cb($data, $result) {
|
||||
global $temp_filename;
|
||||
global $temp_filename;
|
||||
|
||||
// Output read bytes
|
||||
var_dump($result);
|
||||
var_dump($result);
|
||||
|
||||
// Close file
|
||||
eio_close($data);
|
||||
eio_event_loop();
|
||||
eio_close($data);
|
||||
eio_event_loop();
|
||||
|
||||
// Remove temporary file
|
||||
@unlink($temp_filename);
|
||||
@unlink($temp_filename);
|
||||
}
|
||||
|
||||
/* Is called when eio_open() is done */
|
||||
function my_file_opened_callback($data, $result) {
|
||||
// $result should contain the file descriptor
|
||||
if ($result > 0) {
|
||||
// Read 5 bytes starting from third
|
||||
eio_read($result, 5, 2, EIO_PRI_DEFAULT, "my_read_cb", $result);
|
||||
eio_event_loop();
|
||||
} else {
|
||||
if ($result > 0) {
|
||||
// Read 5 bytes starting from third
|
||||
eio_read($result, 5, 2, EIO_PRI_DEFAULT, "my_read_cb", $result);
|
||||
eio_event_loop();
|
||||
} else {
|
||||
// eio_open() failed
|
||||
unlink($data);
|
||||
}
|
||||
unlink($data);
|
||||
}
|
||||
}
|
||||
|
||||
// Open the file for reading and writing
|
||||
eio_open($temp_filename, EIO_O_RDWR, NULL,
|
||||
EIO_PRI_DEFAULT, "my_file_opened_callback", $temp_filename);
|
||||
eio_open($temp_filename, EIO_O_RDWR, NULL,
|
||||
EIO_PRI_DEFAULT, "my_file_opened_callback", $temp_filename);
|
||||
eio_event_loop();
|
||||
?>
|
||||
]]>
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
choice="opt"><type>string</type><parameter>data</parameter><initializer>NULL</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Reads through a whole directory(via the <literal>opendir</literal>, <literal>readdir</literal> and <literal>closedir</literal> system
|
||||
calls) and returns either the names or an array in
|
||||
<parameter>result</parameter> argument of <parameter>callback</parameter>
|
||||
function, depending on the <parameter>flags</parameter> argument.
|
||||
Reads through a whole directory(via the <literal>opendir</literal>, <literal>readdir</literal> and
|
||||
<literal>closedir</literal> system calls) and returns either the names or an array in
|
||||
<parameter>result</parameter> argument of <parameter>callback</parameter>
|
||||
function, depending on the <parameter>flags</parameter> argument.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Directory path.
|
||||
Directory path.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -49,20 +49,20 @@
|
|||
<varlistentry>
|
||||
<term><parameter>pri</parameter></term>
|
||||
<listitem>
|
||||
&eio.request.pri.values;
|
||||
&eio.request.pri.values;
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>callback</parameter></term>
|
||||
<listitem>
|
||||
&eio.callback.proto;
|
||||
&eio.callback.proto;
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -72,267 +72,262 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<function>eio_readdir</function> returns request resource on success, or
|
||||
&false; on error. Sets <parameter>result</parameter> argument of
|
||||
<parameter>callback</parameter> function according to
|
||||
<parameter>flags</parameter>:
|
||||
<function>eio_readdir</function> returns request resource on success, or
|
||||
&false; on error. Sets <parameter>result</parameter> argument of
|
||||
<parameter>callback</parameter> function according to
|
||||
<parameter>flags</parameter>:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<variablelist>
|
||||
|
||||
<!--{{{ EIO_READDIR_* -->
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_READDIR_DENTS</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<function>eio_readdir</function> flag. If specified, the result argument of the callback
|
||||
becomes an array with the following keys:
|
||||
|
||||
<literal>'names'</literal> - array of directory names
|
||||
|
||||
<literal>'dents'</literal> - array of <literal>struct
|
||||
eio_dirent</literal>-like arrays having the following keys each:
|
||||
<variablelist>
|
||||
|
||||
<!--{{{ EIO_READDIR_* -->
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_READDIR_DENTS</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<function>eio_readdir</function> flag. If specified, the result argument of the callback
|
||||
becomes an array with the following keys:
|
||||
<literal>'names'</literal> - array of directory names
|
||||
<literal>'dents'</literal> - array of <literal>struct
|
||||
eio_dirent</literal>-like arrays having the following keys each:
|
||||
<literal>'name'</literal> - the directory name;
|
||||
|
||||
<literal>'type'</literal> - one of <emphasis>EIO_DT_*</emphasis>
|
||||
constants;
|
||||
|
||||
<literal>'inode'</literal> - the inode number, if available, otherwise
|
||||
unspecified;
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_READDIR_DIRS_FIRST</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
When this flag is specified, the names will be returned in an order
|
||||
where likely directories come first, in optimal stat order.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_READDIR_STAT_ORDER</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
When this flag is specified, then the names will be returned in an order
|
||||
suitable for <literal>stat</literal>'ing each one. When planning to
|
||||
<function>stat</function> all files in the given directory, the
|
||||
returned order will likely be
|
||||
fastest.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_READDIR_FOUND_UNKNOWN</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_READDIR_DIRS_FIRST</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
When this flag is specified, the names will be returned in an order
|
||||
where likely directories come first, in optimal stat order.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_READDIR_STAT_ORDER</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
When this flag is specified, then the names will be returned in an order
|
||||
suitable for <literal>stat</literal>'ing each one. When planning to
|
||||
<function>stat</function> all files in the given directory, the
|
||||
returned order will likely be
|
||||
fastest.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_READDIR_FOUND_UNKNOWN</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<!--}}}-->
|
||||
|
||||
</variablelist>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>Node types:
|
||||
<variablelist>
|
||||
|
||||
<para>Node types:
|
||||
<variablelist>
|
||||
|
||||
<!--{{{ EIO_DT_* -->
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_UNKNOWN</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Unknown node type(very common). Further <function>stat</function> needed.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_FIFO</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
FIFO node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_CHR</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_MPC</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Multiplexed char device (v7+coherent) node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_DIR</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Directory node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_NAM</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Xenix special named file node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_BLK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_MPB</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Multiplexed block device (v7+coherent)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_REG</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_NWK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_CMP</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
HP-UX network special node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_LNK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Link node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_SOCK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Socket node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_DOOR</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Solaris door node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_WHT</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_MAX</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Highest node type value
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<!--}}}-->
|
||||
|
||||
</variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_UNKNOWN</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Unknown node type(very common). Further <function>stat</function> needed.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_FIFO</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
FIFO node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_CHR</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_MPC</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Multiplexed char device (v7+coherent) node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_DIR</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Directory node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_NAM</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Xenix special named file node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_BLK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_MPB</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Multiplexed block device (v7+coherent)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_REG</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_NWK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_CMP</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
HP-UX network special node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_LNK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Link node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_SOCK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Socket node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_DOOR</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Solaris door node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_WHT</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Node type
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>EIO_DT_MAX</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Highest node type value
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<!--}}}-->
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -345,13 +340,13 @@
|
|||
<?php
|
||||
/* Is called when eio_readdir() finishes */
|
||||
function my_readdir_callback($data, $result) {
|
||||
echo __FUNCTION__, " called\n";
|
||||
echo "data: "; var_dump($data);
|
||||
echo "result: "; var_dump($result);
|
||||
echo "\n";
|
||||
echo __FUNCTION__, " called\n";
|
||||
echo "data: "; var_dump($data);
|
||||
echo "result: "; var_dump($result);
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
eio_readdir("/var/spool/news", EIO_READDIR_STAT_ORDER | EIO_READDIR_DIRS_FIRST,
|
||||
eio_readdir("/var/spool/news", EIO_READDIR_STAT_ORDER | EIO_READDIR_DIRS_FIRST,
|
||||
EIO_PRI_DEFAULT, "my_readdir_callback");
|
||||
eio_event_loop();
|
||||
?>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -77,29 +77,29 @@ $link = dirname(__FILE__)."/symlink.link";
|
|||
$hardlink = dirname(__FILE__)."/hardlink.link";
|
||||
|
||||
function my_hardlink_cb($data, $result) {
|
||||
global $link, $filename;
|
||||
var_dump(file_exists($data) && !is_link($data));
|
||||
@unlink($data);
|
||||
global $link, $filename;
|
||||
var_dump(file_exists($data) && !is_link($data));
|
||||
@unlink($data);
|
||||
|
||||
eio_symlink($filename, $link, EIO_PRI_DEFAULT, "my_symlink_cb", $link);
|
||||
eio_symlink($filename, $link, EIO_PRI_DEFAULT, "my_symlink_cb", $link);
|
||||
}
|
||||
|
||||
function my_symlink_cb($data, $result) {
|
||||
global $link, $filename;
|
||||
var_dump(file_exists($data) && is_link($data));
|
||||
global $link, $filename;
|
||||
var_dump(file_exists($data) && is_link($data));
|
||||
|
||||
if (!eio_readlink($data, EIO_PRI_DEFAULT, "my_readlink_cb", NULL)) {
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
}
|
||||
if (!eio_readlink($data, EIO_PRI_DEFAULT, "my_readlink_cb", NULL)) {
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
}
|
||||
}
|
||||
|
||||
function my_readlink_cb($data, $result) {
|
||||
global $filename, $link;
|
||||
var_dump($result);
|
||||
global $filename, $link;
|
||||
var_dump($result);
|
||||
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
}
|
||||
|
||||
eio_link($filename, $hardlink, EIO_PRI_DEFAULT, "my_hardlink_cb", $hardlink);
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Short pathname
|
||||
|
||||
Short pathname
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -41,7 +41,7 @@
|
|||
<term><parameter>pri</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -49,7 +49,7 @@
|
|||
<term><parameter>callback</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -57,7 +57,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -81,7 +81,7 @@
|
|||
var_dump(getcwd());
|
||||
|
||||
function my_realpath_allback($data, $result) {
|
||||
var_dump($result);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
eio_realpath("../", EIO_PRI_DEFAULT, "my_realpath_allback");
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -81,20 +81,20 @@
|
|||
<title><function>eio_rename</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
$filename = dirname(__FILE__)."/eio-temp-file.dat";
|
||||
touch($filename);
|
||||
$new_filename = dirname(__FILE__)."/eio-temp-file-new.dat";
|
||||
|
||||
function my_rename_cb($data, $result) {
|
||||
global $filename, $new_filename;
|
||||
global $filename, $new_filename;
|
||||
|
||||
if ($result == 0 && !file_exists($filename) && file_exists($new_filename)) {
|
||||
@unlink($new_filename);
|
||||
echo "eio_rename_ok";
|
||||
} else {
|
||||
@unlink($filename);
|
||||
}
|
||||
if ($result == 0 && !file_exists($filename) && file_exists($new_filename)) {
|
||||
@unlink($new_filename);
|
||||
echo "eio_rename_ok";
|
||||
} else {
|
||||
@unlink($filename);
|
||||
}
|
||||
}
|
||||
|
||||
eio_rename($filename, $new_filename, EIO_PRI_DEFAULT, "my_rename_cb", $filename);
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Directory path
|
||||
Directory path
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -52,7 +52,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -72,16 +72,16 @@
|
|||
<title><function>eio_rmdir</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
$temp_dirname = "eio-temp-dir";
|
||||
mkdir($temp_dirname);
|
||||
|
||||
function my_rmdir_callback($data, $result) {
|
||||
if ($result == 0 && !file_exists($data)) {
|
||||
echo "eio_rmdir_ok";
|
||||
} else if (file_exists($data)) {
|
||||
rmdir($data);
|
||||
}
|
||||
if ($result == 0 && !file_exists($data)) {
|
||||
echo "eio_rmdir_ok";
|
||||
} else if (file_exists($data)) {
|
||||
rmdir($data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<term><parameter>nseconds</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Number of seconds
|
||||
Number of seconds
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<term><parameter>nthreads</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Number of parallel threads.
|
||||
Number of parallel threads.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The file path
|
||||
The file path
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -51,7 +51,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -78,19 +78,19 @@ $tmp_filename = "eio-file.tmp";
|
|||
touch($tmp_filename);
|
||||
|
||||
function my_res_cb($data, $result) {
|
||||
var_dump($data);
|
||||
var_dump($result);
|
||||
var_dump($data);
|
||||
var_dump($result);
|
||||
}
|
||||
|
||||
function my_open_cb($data, $result) {
|
||||
eio_close($result);
|
||||
eio_event_loop();
|
||||
eio_close($result);
|
||||
eio_event_loop();
|
||||
|
||||
@unlink($data);
|
||||
@unlink($data);
|
||||
}
|
||||
|
||||
eio_stat($tmp_filename, EIO_PRI_DEFAULT, "my_res_cb", "eio_stat");
|
||||
eio_open($tmp_filename, EIO_O_RDONLY, NULL,
|
||||
eio_open($tmp_filename, EIO_O_RDONLY, NULL,
|
||||
EIO_PRI_DEFAULT, "my_open_cb", $tmp_filename);
|
||||
eio_event_loop();
|
||||
?>
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -76,8 +76,8 @@ $tmp_filename = '/tmp/eio-file.tmp';
|
|||
touch($tmp_filename);
|
||||
|
||||
function my_statvfs_callback($data, $result) {
|
||||
var_dump($data);
|
||||
var_dump($result);
|
||||
var_dump($data);
|
||||
var_dump($result);
|
||||
|
||||
@unlink($data);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Source path
|
||||
Source path
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -43,7 +43,7 @@
|
|||
<term><parameter>new_path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Target path
|
||||
Target path
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -63,7 +63,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -83,27 +83,27 @@
|
|||
<title><function>eio_symlink</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
<?php
|
||||
$filename = dirname(__FILE__)."/symlink.dat";
|
||||
touch($filename);
|
||||
$link = dirname(__FILE__)."/symlink.link";
|
||||
|
||||
function my_symlink_cb($data, $result) {
|
||||
global $link, $filename;
|
||||
var_dump(file_exists($data) && is_link($data));
|
||||
global $link, $filename;
|
||||
var_dump(file_exists($data) && is_link($data));
|
||||
|
||||
if (!eio_readlink($data, EIO_PRI_DEFAULT, "my_readlink_cb", NULL)) {
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
}
|
||||
if (!eio_readlink($data, EIO_PRI_DEFAULT, "my_readlink_cb", NULL)) {
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
}
|
||||
}
|
||||
|
||||
function my_readlink_cb($data, $result) {
|
||||
global $filename, $link;
|
||||
var_dump($result);
|
||||
global $filename, $link;
|
||||
var_dump($result);
|
||||
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
@unlink($link);
|
||||
@unlink($filename);
|
||||
}
|
||||
|
||||
eio_symlink($filename, $link, EIO_PRI_DEFAULT, "my_symlink_cb", $link);
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<term><parameter>fd</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
File descriptor
|
||||
File descriptor
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -44,7 +44,7 @@
|
|||
<term><parameter>offset</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The starting byte of the file range to be synchronized
|
||||
The starting byte of the file range to be synchronized
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -87,7 +87,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<listitem>
|
||||
<para>
|
||||
File descriptor
|
||||
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -53,7 +53,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
File path
|
||||
File path
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -62,7 +62,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<term><parameter>path</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Path to file
|
||||
Path to file
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -52,7 +52,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<term><parameter>atime</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Access time
|
||||
Access time
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -50,7 +50,7 @@
|
|||
<term><parameter>mtime</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Modification time
|
||||
Modification time
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -70,7 +70,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<term><parameter>str</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Source string
|
||||
Source string
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -53,7 +53,7 @@
|
|||
<term><parameter>length</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Maximum number of bytes to write.
|
||||
Maximum number of bytes to write.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -61,7 +61,7 @@
|
|||
<term><parameter>offset</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Offset from the beginning of file.
|
||||
Offset from the beginning of file.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -81,7 +81,7 @@
|
|||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
Arbitrary variable passed to <parameter>callback</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -16,8 +16,8 @@ $ cvs -z3 -d :pserver:anonymous@cvs.schmorp.de/schmorpforge co libeio
|
|||
$ cd libeio
|
||||
$ ./autogen.sh
|
||||
$ ./configure
|
||||
$ make
|
||||
# make install
|
||||
$ make
|
||||
# make install
|
||||
]]>
|
||||
</screen>
|
||||
Note, the last command needs root priveleges.
|
||||
|
|
Loading…
Reference in a new issue