Documentation

Generic extends Stream
in package
implements Pathable, Statable, Touchable

AbstractYes

Class \Hoa\File\Generic.

Describe a super-file.

Tags
copyright

Copyright © 2007-2017 Hoa community

license

New BSD License

Table of Contents

Interfaces

Pathable
Interface \Hoa\Stream\IStream\Pathable.
Statable
Interface \Hoa\Stream\IStream\Statable.
Touchable
Interface \Hoa\Stream\IStream\Touchable.

Properties

$_mode  : string
Mode.

Methods

changeGroup()  : bool
Change file group.
changeMode()  : bool
Change file mode.
changeOwner()  : bool
Change file owner.
clearAllStatisticCaches()  : void
Clear all files status cache.
clearStatisticCache()  : void
Clear file status cache.
copy()  : bool
Copy file.
delete()  : bool
Delete a file.
getATime()  : int
Get last access time of file.
getBasename()  : string
Get filename component of path.
getCTime()  : int
Get inode change time of file.
getDirname()  : string
Get directory name component of path.
getExtension()  : string
Get file extension (if exists).
getFilename()  : string
Get filename without extension.
getGroup()  : int
Get file group.
getINode()  : int
Get inode.
getMode()  : string
Get the open mode.
getMTime()  : int
Get file modification time.
getOwner()  : int
Get file owner.
getPermissions()  : int
Get file permissions.
getReadablePermissions()  : string
Get file permissions as a string.
getRealPath()  : string
Get a canonicalized absolute pathname.
getSize()  : int
Get size.
getStatistic()  : array<string|int, mixed>
Get informations about a file.
isBlockSpecial()  : bool
Check if it is block special.
isCaseSensitive()  : bool
Check if the system is case sensitive or not.
isCharacterSpecial()  : bool
Check if it is character special file.
isDirectory()  : bool
Check if it is a directory.
isExecutable()  : bool
Check if the file is executable.
isFIFOPipe()  : bool
Check if it is a FIFO pipe.
isFile()  : bool
Check if it is a file.
isLink()  : bool
Check if it is a link.
isReadable()  : bool
Check if the file is readable.
isSocket()  : bool
Check if it is a socket.
isUnknown()  : bool
Check if it is an unknown type.
isWritable()  : bool
Check if the file is writable.
move()  : bool
Move a file.
touch()  : bool
Set access and modification time of file.
umask()  : int
Change the current umask.
setMode()  : string
Set the open mode.

Properties

$_mode

Mode.

protected string $_mode = null

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

clearAllStatisticCaches()

Clear all files status cache.

public static clearAllStatisticCaches() : void

clearStatisticCache()

Clear file status cache.

public clearStatisticCache() : void

copy()

Copy file.

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

Return the destination file path if succeed, false otherwise.

Parameters
$to : string

Destination path.

$force : bool = StreamIStreamTouchable::DO_NOT_OVERWRITE

Force to copy if the file $to already exists. Use the \Hoa\Stream\IStream\Touchable::*OVERWRITE constants.

Return values
bool

delete()

Delete a file.

public delete() : bool
Return values
bool

getATime()

Get last access time of file.

public getATime() : int
Return values
int

getBasename()

Get filename component of path.

public getBasename() : string
Return values
string

getCTime()

Get inode change time of file.

public getCTime() : int
Return values
int

getDirname()

Get directory name component of path.

public getDirname() : string
Return values
string

getExtension()

Get file extension (if exists).

public getExtension() : string
Return values
string

getFilename()

Get filename without extension.

public getFilename() : string
Return values
string

getGroup()

Get file group.

public getGroup() : int
Return values
int

getINode()

Get inode.

public getINode() : int
Return values
int

getMode()

Get the open mode.

public getMode() : string
Return values
string

getMTime()

Get file modification time.

public getMTime() : int
Return values
int

getOwner()

Get file owner.

public getOwner() : int
Return values
int

getPermissions()

Get file permissions.

public getPermissions() : int
Return values
int

getReadablePermissions()

Get file permissions as a string.

public getReadablePermissions() : string

Result sould be interpreted like this:

  • s: socket;
  • l: symbolic link;
  • -: regular;
  • b: block special;
  • d: directory;
  • c: character special;
  • p: FIFO pipe;
  • u: unknown.
Return values
string

getRealPath()

Get a canonicalized absolute pathname.

public getRealPath() : string
Return values
string

getSize()

Get size.

public getSize() : int
Return values
int

getStatistic()

Get informations about a file.

public getStatistic() : array<string|int, mixed>
Return values
array<string|int, mixed>

isBlockSpecial()

Check if it is block special.

public isBlockSpecial() : bool
Return values
bool

isCaseSensitive()

Check if the system is case sensitive or not.

public static isCaseSensitive() : bool
Return values
bool

isCharacterSpecial()

Check if it is character special file.

public isCharacterSpecial() : bool
Return values
bool

isDirectory()

Check if it is a directory.

public isDirectory() : bool
Return values
bool

isExecutable()

Check if the file is executable.

public isExecutable() : bool
Return values
bool

isFIFOPipe()

Check if it is a FIFO pipe.

public isFIFOPipe() : bool
Return values
bool

isFile()

Check if it is a file.

public isFile() : bool
Return values
bool

Check if it is a link.

public isLink() : bool
Return values
bool

isReadable()

Check if the file is readable.

public isReadable() : bool
Return values
bool

isSocket()

Check if it is a socket.

public isSocket() : bool
Return values
bool

isUnknown()

Check if it is an unknown type.

public isUnknown() : bool
Return values
bool

isWritable()

Check if the file is writable.

public isWritable() : bool
Return values
bool

move()

Move a file.

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

New name.

$force : bool = StreamIStreamTouchable::DO_NOT_OVERWRITE

Force to move if the file $name already exists. Use the \Hoa\Stream\IStream\Touchable::*OVERWRITE constants.

$mkdir : bool = StreamIStreamTouchable::DO_NOT_MAKE_DIRECTORY

Force to make directory if does not exist. Use the \Hoa\Stream\IStream\Touchable::*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

setMode()

Set the open mode.

protected setMode(string $mode) : string
Parameters
$mode : string

Open mode. Please, see the child::MODE_* constants.

Return values
string

        
On this page

Search results