Amp\File\Handle interfaceHandle

Summary

Properties

Methods

Methods

read —public functionread(int$len):Amp\Promise

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

Type Parameter Description Default Value
int $len No documentation. none
write —public functionwrite(string$data):Amp\Promise

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

Type Parameter Description Default Value
string $data No documentation. none
close —public functionclose():Amp\Promise

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 functionseek(int$position,int$whence =\SEEK_SET):void

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 functiontell():int

Return the current internal offset position of the file handle

eof —public functioneof():bool

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

path —public functionpath():string

Retrieve the path used when opening the file handle

mode —public functionmode():string

Retrieve the mode used when opening the file handle