Amp\File\BlockingHandle class BlockingHandle implements Amp\File\Handle

Summary

Properties

Methods

Properties

Methods

__construct — public function __construct(resource $fh, $path, $mode)
No documentation.
Type Parameter Description Default Value
resource $fh An open uv filesystem descriptor none
mixed $path No documentation. none
mixed $mode No documentation. none
read — public function read(int $len)

Read $len bytes from the open file handle starting at $offset

Type Parameter Description Default Value
int $len No documentation. none
write — public function write(string $data)

Write $data to the open file handle starting at $offset

Type Parameter Description Default Value
string $data No documentation. none
close — public function close()

Close the file handle

Applications are not required to manually close handles -- they will be unloaded automatically when the object is garbage collected.

seek — public function seek(int $position, int $whence = \SEEK_SET)

Set the handle's internal pointer position

$whence values:

SEEK_SET - Set position equal to offset bytes. SEEK_CUR - Set position to current location plus offset. SEEK_END - Set position to end-of-file plus offset.

Type Parameter Description Default Value
int $position No documentation. none
int $whence No documentation. \SEEK_SET
tell — public function tell()

Return the current internal offset position of the file handle

eof — public function eof()

Test for "end-of-file" on the file handle

path — public function path()

Retrieve the path used when opening the file handle

mode — public function mode()

Retrieve the mode used when opening the file handle