A file stream object.

package filicious-core
author Christian Schiffler
author Tristan Lins
author Oliver Hoff

 Methods

__construct()

__construct(string $url, \Filicious\Internals\Pathname $file) 

Parameters

$url

string

$file

Retrieve the underlaying resource

cast(int $as) : resource | boolean

Parameters

$as

int

Returns

resourceboolean

Close an resource

close() 

Tests for end-of-file on a file pointer

eof() : boolean

Returns

boolean

Flushes the output

flush() : boolean

Returns

boolean

getFile()

getFile() : \Filicious\File

Returns

getResource()

getResource() : resource

Returns

resource

Advisory file locking

lock(\Filicious\Stream\mode $operation) : bool

Parameters

Returns

bool

Opens file or URL

open(\Filicious\Stream\StreamMode $mode) 

Parameters

$mode

Read from stream

read(int $count) : string

Parameters

$count

int

Returns

string

Seeks to specific location in a stream

seek(int $offset, int $whence) : mixed

Parameters

$offset

int

$whence

int

Returns

mixed

Retrieve information about a file resource

stat() : array

Returns

array

Retrieve the current position of a stream

tell() : int

Returns

int

Truncate stream

truncate(int $size) : boolean

Parameters

$size

int

Returns

boolean

Write to stream

write(string $data) : mixed

Parameters

$data

string

Returns

mixed

 Properties

   

$pathname

$pathname : \Filicious\Internals\Pathname
 

$resource

$resource : resource
 

$selfResource

$selfResource : resource
 

$streamIndex

$streamIndex : null | int
 

$url

$url : string