FileStream
extends GenericStream
in package
Table of Contents
Constants
- APPEND_READ_WRITE = 'a+b'
- APPEND_WRITE = 'ab'
- CREATE_READ_WRITE = 'x+b'
- CREATE_WRITE = 'xb'
- CURRENT = SEEK_CUR
- END = SEEK_END
- LOCK_NON_BLOCKING = LOCK_NB
- LOCK_NONE = 0
- LOCK_READ = LOCK_SH
- LOCK_WRITE = LOCK_EX
- NEW_READ_WRITE = 'w+b'
- NEW_WRITE = 'wb'
- OPEN_OR_CREATE_READ_WRITE = 'c+b'
- OPEN_OR_CREATE_WRITE = 'cb'
- OPEN_READ = 'rb'
- OPEN_READ_WRITE = 'r+b'
- READABLE = ['r', 'rb', 'r+', 'r+b', 'w+', 'w+b', 'a+', 'a+b', 'x+', 'x+b', 'c+', 'c+b']
- START = SEEK_SET
- WRITEABLE = ['r+', 'r+b', 'w', 'wb', 'w+', 'w+b', 'a', 'ab', 'a+', 'a+b', 'x', 'xb', 'x+', 'x+b', 'c', 'cb', 'c+', 'c+b']
Methods
- __construct() : mixed
- __destruct() : mixed
- __toString() : string
- appendReadWrite() : FileStream
- appendWrite() : FileStream
- canRead() : bool
- canSeek() : bool
- canWrite() : bool
- close() : void
- Free, release or reset unmanaged resources.
- copyTo() : void
- createReadWrite() : FileStream
- createWrite() : FileStream
- flush() : void
- getLength() : int
- getPosition() : int
- getResource() : mixed
- hasTimedOut() : bool
- isBlocking() : bool
- isEnded() : bool
- newReadWrite() : FileStream
- newWrite() : FileStream
- openOrCreateReadWrite() : FileStream
- openOrCreateWrite() : FileStream
- openRead() : FileStream
- openReadWrite() : FileStream
- read() : string|null
- readByte() : int
- readChar() : string|null
- readLine() : string|null
- seek() : int
- setLength() : void
- write() : void
- writeByte() : void
- writeChar() : void
- writeLine() : void
Constants
APPEND_READ_WRITE
public
mixed
APPEND_READ_WRITE
= 'a+b'
APPEND_WRITE
public
mixed
APPEND_WRITE
= 'ab'
CREATE_READ_WRITE
public
mixed
CREATE_READ_WRITE
= 'x+b'
CREATE_WRITE
public
mixed
CREATE_WRITE
= 'xb'
CURRENT
public
mixed
CURRENT
= SEEK_CUR
END
public
mixed
END
= SEEK_END
LOCK_NON_BLOCKING
public
mixed
LOCK_NON_BLOCKING
= LOCK_NB
LOCK_NONE
public
mixed
LOCK_NONE
= 0
LOCK_READ
public
mixed
LOCK_READ
= LOCK_SH
LOCK_WRITE
public
mixed
LOCK_WRITE
= LOCK_EX
NEW_READ_WRITE
public
mixed
NEW_READ_WRITE
= 'w+b'
NEW_WRITE
public
mixed
NEW_WRITE
= 'wb'
OPEN_OR_CREATE_READ_WRITE
public
mixed
OPEN_OR_CREATE_READ_WRITE
= 'c+b'
OPEN_OR_CREATE_WRITE
public
mixed
OPEN_OR_CREATE_WRITE
= 'cb'
OPEN_READ
public
mixed
OPEN_READ
= 'rb'
OPEN_READ_WRITE
public
mixed
OPEN_READ_WRITE
= 'r+b'
READABLE
public
mixed
READABLE
= ['r', 'rb', 'r+', 'r+b', 'w+', 'w+b', 'a+', 'a+b', 'x+', 'x+b', 'c+', 'c+b']
START
public
mixed
START
= SEEK_SET
WRITEABLE
public
mixed
WRITEABLE
= ['r+', 'r+b', 'w', 'wb', 'w+', 'w+b', 'a', 'ab', 'a+', 'a+b', 'x', 'xb', 'x+', 'x+b', 'c', 'cb', 'c+', 'c+b']
Methods
__construct()
public
__construct(string $path, string $mode, int $lock) : mixed
Parameters
- $path : string
- $mode : string
- $lock : int
__destruct()
public
__destruct() : mixed
__toString()
public
__toString() : string
Return values
stringappendReadWrite()
public
static appendReadWrite(string $path[, int $lock = self::LOCK_NONE ]) : FileStream
Parameters
- $path : string
- $lock : int = self::LOCK_NONE
Return values
FileStreamappendWrite()
public
static appendWrite(string $path[, int $lock = self::LOCK_NONE ]) : FileStream
Parameters
- $path : string
- $lock : int = self::LOCK_NONE
Return values
FileStreamcanRead()
public
abstract canRead() : bool
Return values
boolcanSeek()
public
abstract canSeek() : bool
Return values
boolcanWrite()
public
abstract canWrite() : bool
Return values
boolclose()
Free, release or reset unmanaged resources.
public
close() : void
copyTo()
public
copyTo(Stream $other) : void
Parameters
- $other : Stream
createReadWrite()
public
static createReadWrite(string $path[, int $lock = self::LOCK_NONE ]) : FileStream
Parameters
- $path : string
- $lock : int = self::LOCK_NONE
Return values
FileStreamcreateWrite()
public
static createWrite(string $path[, int $lock = self::LOCK_NONE ]) : FileStream
Parameters
- $path : string
- $lock : int = self::LOCK_NONE
Return values
FileStreamflush()
public
abstract flush() : void
getLength()
public
abstract getLength() : int
Return values
intgetPosition()
public
abstract getPosition() : int
Return values
intgetResource()
public
getResource() : mixed
hasTimedOut()
public
abstract hasTimedOut() : bool
Return values
boolisBlocking()
public
abstract isBlocking() : bool
Return values
boolisEnded()
public
abstract isEnded() : bool
Return values
boolnewReadWrite()
public
static newReadWrite(string $path[, int $lock = self::LOCK_NONE ]) : FileStream
Parameters
- $path : string
- $lock : int = self::LOCK_NONE
Return values
FileStreamnewWrite()
public
static newWrite(string $path[, int $lock = self::LOCK_NONE ]) : FileStream
Parameters
- $path : string
- $lock : int = self::LOCK_NONE
Return values
FileStreamopenOrCreateReadWrite()
public
static openOrCreateReadWrite(string $path[, int $lock = self::LOCK_NONE ]) : FileStream
Parameters
- $path : string
- $lock : int = self::LOCK_NONE
Return values
FileStreamopenOrCreateWrite()
public
static openOrCreateWrite(string $path[, int $lock = self::LOCK_NONE ]) : FileStream
Parameters
- $path : string
- $lock : int = self::LOCK_NONE
Return values
FileStreamopenRead()
public
static openRead(string $path[, int $lock = self::LOCK_NONE ]) : FileStream
Parameters
- $path : string
- $lock : int = self::LOCK_NONE
Return values
FileStreamopenReadWrite()
public
static openReadWrite(string $path[, int $lock = self::LOCK_NONE ]) : FileStream
Parameters
- $path : string
- $lock : int = self::LOCK_NONE
Return values
FileStreamread()
public
abstract read(int $length) : string|null
Parameters
- $length : int
Return values
string|nullreadByte()
public
readByte() : int
Return values
intreadChar()
public
abstract readChar() : string|null
Return values
string|nullreadLine()
public
abstract readLine() : string|null
Return values
string|nullseek()
public
abstract seek(int $offset[, int $origin = self::START ]) : int
Parameters
- $offset : int
- $origin : int = self::START
Return values
intsetLength()
public
abstract setLength(int $length) : void
Parameters
- $length : int
write()
public
abstract write(string $buffer[, int $length = -1 ]) : void
Parameters
- $buffer : string
- $length : int = -1
writeByte()
public
writeByte(int $byte) : void
Parameters
- $byte : int
writeChar()
public
abstract writeChar(string $char) : void
Parameters
- $char : string
writeLine()
public
writeLine(string $line) : void
Parameters
- $line : string