Documentation

Touchable extends Stream

Interface \Hoa\Stream\IStream\Touchable.

Interface for touchable input/output.

Tags
copyright

Copyright © 2007-2017 Hoa community

license

New BSD License

Table of Contents

Constants

DO_NOT_MAKE_DIRECTORY  = false
Do not make directory if does not exist.
DO_NOT_OVERWRITE  = false
Do not overwrite file if already exists.
MAKE_DIRECTORY  = true
Make directory if does not exist.
OVERWRITE  = true
Overwrite file if already exists.

Methods

changeGroup()  : bool
Change file group.
changeMode()  : bool
Change file mode.
changeOwner()  : bool
Change file owner.
copy()  : bool
Copy file.
delete()  : bool
Delete a file.
getStream()  : resource
Get the current stream.
move()  : bool
Move a file.
touch()  : bool
Set access and modification time of file.
umask()  : int
Change the current umask.

Constants

DO_NOT_MAKE_DIRECTORY

Do not make directory if does not exist.

public mixed DO_NOT_MAKE_DIRECTORY = false
Tags
const

bool

DO_NOT_OVERWRITE

Do not overwrite file if already exists.

public mixed DO_NOT_OVERWRITE = false
Tags
const

bool

MAKE_DIRECTORY

Make directory if does not exist.

public mixed MAKE_DIRECTORY = true
Tags
const

bool

OVERWRITE

Overwrite file if already exists.

public mixed OVERWRITE = true
Tags
const

bool

Methods

changeGroup()

Change file group.

public changeGroup(mixed $group) : bool
Parameters
$group : mixed

Group name or number.

Return values
bool

changeMode()

Change file mode.

public changeMode(int $mode) : bool
Parameters
$mode : int

Mode (in octal!).

Return values
bool

changeOwner()

Change file owner.

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

User.

Return values
bool

copy()

Copy file.

public copy(string $to[, bool $force = self::DO_NOT_OVERWRITE ]) : bool

Return the destination file path if succeed, false otherwise.

Parameters
$to : string

Destination path.

$force : bool = self::DO_NOT_OVERWRITE

Force to copy if the file $to already exists. Use the self::*OVERWRITE constants.

Return values
bool

delete()

Delete a file.

public delete() : bool
Return values
bool

getStream()

Get the current stream.

public getStream() : resource
Return values
resource

move()

Move a file.

public move(string $name[, bool $force = self::DO_NOT_OVERWRITE ][, bool $mkdir = self::DO_NOT_MAKE_DIRECTORY ]) : bool
Parameters
$name : string

New name.

$force : bool = self::DO_NOT_OVERWRITE

Force to move if the file $name already exists. Use the self::*OVERWRITE constants.

$mkdir : bool = self::DO_NOT_MAKE_DIRECTORY

Force to make directory if does not exist. Use the self::*DIRECTORY constants.

Return values
bool

touch()

Set access and modification time of file.

public touch([int $time = -1 ][, int $atime = -1 ]) : bool
Parameters
$time : int = -1

Time. If equals to -1, time() should be used.

$atime : int = -1

Access time. If equals to -1, $time should be used.

Return values
bool

umask()

Change the current umask.

public static umask([int $umask = null ]) : int
Parameters
$umask : int = null

Umask (in octal!). If null, given the current umask value.

Return values
int

        
On this page

Search results