array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.eio-fallocate.php', 1 => 'eio_fallocate', 2 => 'Allows the caller to directly manipulate the allocated disk space for a file', ), 'up' => array ( 0 => 'ref.eio.php', 1 => 'Eio 函数', ), 'prev' => array ( 0 => 'function.eio-event-loop.php', 1 => 'eio_event_loop', ), 'next' => array ( 0 => 'function.eio-fchmod.php', 1 => 'eio_fchmod', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/eio/functions/eio-fallocate.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PECL eio >= 0.0.1dev)
eio_fallocate — Allows the caller to directly manipulate the allocated disk space for a file
$fd,$mode,$offset,$length,$pri = EIO_PRI_DEFAULT,$callback = NULL,$data = NULL
eio_fallocate() allows the caller to directly manipulate the allocated disk space for the
file specified by fd file descriptor for the byte
range starting at offset and continuing for
length bytes.
注意: File should be opened for writing
EIO_O_CREATshould be logically OR'd withEIO_O_WRONLY, orEIO_O_RDWR
fdmodeEIO_FALLOC_FL_KEEP_SIZE (the same as POSIX constant
FALLOC_FL_KEEP_SIZE).
offsetlengthpriEIO_PRI_DEFAULT,EIO_PRI_MIN,EIO_PRI_MAX 或 null。如果是
null,pri 将设为
EIO_PRI_DEFAULT。
callback
callback
函数在请求完成时被调用。其应匹配一下原型:
void callback(mixed $data, int $result[, resource $req]);dataresultreqdatacallback.
eio_fallocate() returns request resource on success, 或者在失败时返回 false.