Read
extends Link
in package
implements
In
Class \Hoa\File\Link\Read.
File handler.
Tags
Table of Contents
Interfaces
- In
- Interface \Hoa\Stream\IStream\In.
Methods
- __construct() : mixed
- Open a file.
- changeGroup() : bool
- Change file group.
- changeOwner() : bool
- Change file owner.
- create() : bool
- Create a link.
- eof() : bool
- Test for end-of-file.
- getPermissions() : int
- Get file permissions.
- getStatistic() : array<string|int, mixed>
- Get informations about a link.
- getTarget() : Generic
- Get the target of a symbolic link.
- getTargetName() : string
- Get the target name of a symbolic link.
- read() : string
- Read n characters.
- readAll() : string
- Read all, i.e. read as much as possible.
- readArray() : array<string|int, mixed>
- Read an array.
- readBoolean() : bool
- Read a boolean.
- readCharacter() : string
- Read a character.
- readFloat() : float
- Read a float.
- readInteger() : int
- Read an integer.
- readLine() : string
- Read a line.
- readString() : string
- Alias of $this->read().
- scanf() : array<string|int, mixed>
- Parse input from a stream according to a format.
- _open() : resource
- Open the stream and return the associated resource.
Methods
__construct()
Open a file.
public
__construct(string $streamName[, string $mode = parent::MODE_READ ][, string $context = null ][, bool $wait = false ]) : mixed
Parameters
- $streamName : string
-
Stream name.
- $mode : string = parent::MODE_READ
-
Open mode, see the parent::MODE_* constants.
- $context : string = null
-
Context ID (please, see the \Hoa\Stream\Context class).
- $wait : bool = false
-
Differ opening or not.
changeGroup()
Change file group.
public
changeGroup(mixed $group) : bool
Parameters
- $group : mixed
-
Group name or number.
Return values
boolchangeOwner()
Change file owner.
public
changeOwner(mixed $user) : bool
Parameters
- $user : mixed
-
User.
Return values
boolcreate()
Create a link.
public
static create(string $name, string $target) : bool
Parameters
- $name : string
-
Link name.
- $target : string
-
Target name.
Return values
booleof()
Test for end-of-file.
public
eof() : bool
Return values
boolgetPermissions()
Get file permissions.
public
getPermissions() : int
Return values
intgetStatistic()
Get informations about a link.
public
getStatistic() : array<string|int, mixed>
Return values
array<string|int, mixed>getTarget()
Get the target of a symbolic link.
public
getTarget() : Generic
Tags
Return values
GenericgetTargetName()
Get the target name of a symbolic link.
public
getTargetName() : string
Return values
stringread()
Read n characters.
public
read(int $length) : string
Parameters
- $length : int
-
Length.
Tags
Return values
stringreadAll()
Read all, i.e. read as much as possible.
public
readAll([int $offset = 0 ]) : string
Parameters
- $offset : int = 0
-
Offset.
Return values
stringreadArray()
Read an array.
public
readArray([string $format = null ]) : array<string|int, mixed>
Alias of the $this->scanf() method.
Parameters
- $format : string = null
-
Format (see printf's formats).
Return values
array<string|int, mixed>readBoolean()
Read a boolean.
public
readBoolean() : bool
Return values
boolreadCharacter()
Read a character.
public
readCharacter() : string
Return values
stringreadFloat()
Read a float.
public
readFloat([int $length = 1 ]) : float
Parameters
- $length : int = 1
-
Length.
Return values
floatreadInteger()
Read an integer.
public
readInteger([int $length = 1 ]) : int
Parameters
- $length : int = 1
-
Length.
Return values
intreadLine()
Read a line.
public
readLine() : string
Return values
stringreadString()
Alias of $this->read().
public
readString(int $length) : string
Parameters
- $length : int
-
Length.
Return values
stringscanf()
Parse input from a stream according to a format.
public
scanf(string $format) : array<string|int, mixed>
Parameters
- $format : string
-
Format (see printf's formats).
Return values
array<string|int, mixed>_open()
Open the stream and return the associated resource.
protected
& _open(string $streamName[, Context $context = null ]) : resource
Parameters
- $streamName : string
-
Stream name (e.g. path or URL).
- $context : Context = null
-
Context.