Touchable
extends
Stream
in
Interface \Hoa\Stream\IStream\Touchable.
Interface for touchable input/output.
Tags
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
DO_NOT_OVERWRITE
Do not overwrite file if already exists.
public
mixed
DO_NOT_OVERWRITE
= false
Tags
MAKE_DIRECTORY
Make directory if does not exist.
public
mixed
MAKE_DIRECTORY
= true
Tags
OVERWRITE
Overwrite file if already exists.
public
mixed
OVERWRITE
= true
Tags
Methods
changeGroup()
Change file group.
public
changeGroup(mixed $group) : bool
Parameters
- $group : mixed
-
Group name or number.
Return values
boolchangeMode()
Change file mode.
public
changeMode(int $mode) : bool
Parameters
- $mode : int
-
Mode (in octal!).
Return values
boolchangeOwner()
Change file owner.
public
changeOwner(mixed $user) : bool
Parameters
- $user : mixed
-
User.
Return values
boolcopy()
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
booldelete()
Delete a file.
public
delete() : bool
Return values
boolgetStream()
Get the current stream.
public
getStream() : resource
Return values
resourcemove()
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
booltouch()
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
boolumask()
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.