Output stream subclass for file streams.

package phing.system.io

 Methods

Construct a new FileOutputStream.

__construct(mixed $file, boolean $append) 

Parameters

$file

mixed

$append

boolean

Whether to append bytes to end of file rather than beginning.

Exceptions

\Exception - if invalid argument specified.
\IOException - if unable to open file.

Returns a string representation of the attached file.

__toString() : string

Returns

string

Closes attached stream, flushing output first.

close() : void
Inherited
inherited_from \OutputStream::close()

Exceptions

\IOException if cannot close stream (note that attempting to close an already closed stream will not raise an IOException)

Flushes stream.

flush() 
Inherited
inherited_from \OutputStream::flush()

Exceptions

\IOException if unable to flush data (e.g. stream is not open).

Writes data to stream.

write(string $buf, int $off, int $len) : void
Inherited
inherited_from \OutputStream::write()

Parameters

$buf

string

Binary/character data to write.

$off

int

(Optional) offset.

$len

int

(Optional) number of bytes/chars to write.

Exceptions

\IOException - if there is an error writing to stream

 Properties

 

The associated file.

$file : \PhingFile
 

The configured PHP stream.

$stream : resource
Inherited
inherited_from \OutputStream::$$stream