uTools-Manuals/docs/php/eio_fallocate.html
2019-04-08 23:22:26 +08:00

189 lines
5.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Allows the caller to directly manipulate the allocated disk
space for a file</title>
</head>
<body class="docs"></div>
<div id="layout">
<div id="layout-content"><div id="function.eio-fallocate" class="refentry">
<div class="refnamediv">
<h1 class="refname">eio_fallocate</h1>
<p class="verinfo">(PECL eio &gt;= 0.0.1dev)</p><p class="refpurpose"><span class="refname">eio_fallocate</span> &mdash; <span class="dc-title">Allows the caller to directly manipulate the allocated disk
space for a file</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.eio-fallocate-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>eio_fallocate</strong></span>
( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$fd</code></span>
, <span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code></span>
, <span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code></span>
, <span class="methodparam"><span class="type">int</span> <code class="parameter">$length</code></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$pri</code><span class="initializer"> = EIO_PRI_DEFAULT</span></span>
[, <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$callback</code><span class="initializer"> = NULL</span></span>
[, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$data</code><span class="initializer"> = NULL</span></span>
]]] ) : <span class="type">resource</span></div>
<p class="para rdfs-comment">
<span class="function"><strong>eio_fallocate()</strong></span> allows the caller to directly manipulate the allocated disk space for the
file specified by <code class="parameter">fd</code> file descriptor for the byte
range starting at <code class="parameter">offset</code> and continuing for
<code class="parameter">length</code> bytes.
</p>
<blockquote class="note"><p><strong class="note">Note</strong>:
<strong>File should be opened for writing</strong><br />
<p class="para"><strong><code>EIO_O_CREAT</code></strong> should be logically
<em class="emphasis">OR</em>&#039;d with <strong><code>EIO_O_WRONLY</code></strong>, or
<strong><code>EIO_O_RDWR</code></strong>
</p>
</p></blockquote>
</div>
<div class="refsect1 parameters" id="refsect1-function.eio-fallocate-parameters">
<h3 class="title">参数</h3>
<dl>
<dt>
<code class="parameter">fd</code></dt>
<dd>
<p class="para">
Stream, Socket resource, or numeric file descriptor, e.g. returned by <span class="function"><a href="eio_open.html" class="function">eio_open()</a></span>.
</p>
</dd>
<dt>
<code class="parameter">mode</code></dt>
<dd>
<p class="para">Currently only one flag is supported for mode:
<strong><code>EIO_FALLOC_FL_KEEP_SIZE</code></strong> (the same as POSIX constant
<strong><code>FALLOC_FL_KEEP_SIZE</code></strong>).
</p>
</dd>
<dt>
<code class="parameter">offset</code></dt>
<dd>
<p class="para">
Specifies start of the byte range.
</p>
</dd>
<dt>
<code class="parameter">length</code></dt>
<dd>
<p class="para">
Specifies length the byte range.
</p>
</dd>
<dt>
<code class="parameter">pri</code></dt>
<dd>
<p class="para">请求的优先级:<strong><code>EIO_PRI_DEFAULT</code></strong><strong><code>EIO_PRI_MIN</code></strong><strong><code>EIO_PRI_MAX</code></strong><strong><code>NULL</code></strong>。如果是
<strong><code>NULL</code></strong><code class="parameter">pri</code> 将设为
<strong><code>EIO_PRI_DEFAULT</code></strong>
</p>
</dd>
<dt>
<code class="parameter">callback</code></dt>
<dd>
<p class="para">
<code class="parameter">callback</code>
函数在请求完成时被调用。其应匹配一下原型:<div class="example-contents"><div class="phpcode"><pre><span style="color: #000000">
void&nbsp;callback(mixed&nbsp;$data,&nbsp;int&nbsp;$result[,&nbsp;resource&nbsp;$req]);</span>
</pre></div></div>
<dl>
<dt>
<code class="parameter">data</code></dt>
<dd>
<p class="para">传递给请求的用户数据。</p></dd>
<dt>
<code class="parameter">result</code></dt>
<dd>
<p class="para">针对请求的结果的值。通常是相应的系统调用返回的值。</p></dd>
<dt>
<code class="parameter">req</code></dt>
<dd>
<p class="para">可选的请求资源,可被 <span class="function"><a href="eio_get_last_error.html" class="function">eio_get_last_error()</a></span>
之类的函数使用。</p></dd>
</dl>
</p>
</dd>
<dt>
<code class="parameter">data</code></dt>
<dd>
<p class="para">
Arbitrary variable passed to <code class="parameter">callback</code>.
</p>
</dd>
</dl>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.eio-fallocate-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
<span class="function"><strong>eio_fallocate()</strong></span> returns request resource on success or <strong><code>FALSE</code></strong> on error.
</p>
</div>
</div></div></div></body></html>