Documentation

Write extends Link
in package
implements Out

Class \Hoa\File\Link\Write.

File handler.

Tags
license

New BSD License

Table of Contents

Interfaces

Out
Interface \Hoa\Stream\IStream\Out.

Methods

__construct()  : mixed
Open a file.
changeGroup()  : bool
Change file group.
changeOwner()  : bool
Change file owner.
create()  : bool
Create a link.
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.
truncate()  : bool
Truncate a file to a given length.
write()  : mixed
Write n characters.
writeAll()  : mixed
Write all, i.e. as much as possible.
writeArray()  : mixed
Write an array.
writeBoolean()  : mixed
Write a boolean.
writeCharacter()  : mixed
Write a character.
writeFloat()  : mixed
Write a float.
writeInteger()  : mixed
Write an integer.
writeLine()  : mixed
Write a line.
writeString()  : mixed
Write a string.
_open()  : resource
Open the stream and return the associated resource.

Methods

__construct()

Open a file.

public __construct(string $streamName[, string $mode = parent::MODE_APPEND_WRITE ][, string $context = null ][, bool $wait = false ]) : mixed
Parameters
$streamName : string

Stream name.

$mode : string = parent::MODE_APPEND_WRITE

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
bool

changeOwner()

Change file owner.

public changeOwner(mixed $user) : bool
Parameters
$user : mixed

User.

Return values
bool

create()

Create a link.

public static create(string $name, string $target) : bool
Parameters
$name : string

Link name.

$target : string

Target name.

Return values
bool

getPermissions()

Get file permissions.

public getPermissions() : int
Return values
int

getStatistic()

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
throws
Exception
Return values
Generic

getTargetName()

Get the target name of a symbolic link.

public getTargetName() : string
Return values
string

truncate()

Truncate a file to a given length.

public truncate(int $size) : bool
Parameters
$size : int

Size.

Return values
bool

write()

Write n characters.

public write(string $string, int $length) : mixed
Parameters
$string : string

String.

$length : int

Length.

Tags
throws
Exception

writeAll()

Write all, i.e. as much as possible.

public writeAll(string $string) : mixed
Parameters
$string : string

String.

writeArray()

Write an array.

public writeArray(array<string|int, mixed> $array) : mixed
Parameters
$array : array<string|int, mixed>

Array.

writeBoolean()

Write a boolean.

public writeBoolean(bool $boolean) : mixed
Parameters
$boolean : bool

Boolean.

writeCharacter()

Write a character.

public writeCharacter(string $char) : mixed
Parameters
$char : string

Character.

writeFloat()

Write a float.

public writeFloat(float $float) : mixed
Parameters
$float : float

Float.

writeInteger()

Write an integer.

public writeInteger(int $integer) : mixed
Parameters
$integer : int

Integer.

writeLine()

Write a line.

public writeLine(string $line) : mixed
Parameters
$line : string

Line.

writeString()

Write a string.

public writeString(string $string) : mixed
Parameters
$string : string

String.

_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.

Tags
throws
FileDoesNotExist
throws
Exception
Return values
resource

        
On this page

Search results