Actions

API16

JStream

From Joomla! Documentation

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[Edit Descripton] Description:JStream

Contents

Defined in

libraries/joomla/filesystem/stream.php

Methods

Method name Description
__construct Constructor
__destruct Destructor
open Open a stream with some lazy loading smarts
close Attempt to close a file handle Will return false if it failed and true on success Note: if the file is not open the system will return true Note: this function destroys the file handle as well
eof Work out if we're at the end of the file for a stream
filesize Retrieve the file size of the path
gets
read Read a file Handles user space streams appropriately otherwise any read will return 8192
seek Seek the file Note: the return value is different to that of fseek
tell
write File write Note: Whilst this function accepts a reference, the underlying fwrite will do a copy! This will roughly double the memory allocation for any write you do. Specifying chunked will get around this by only writing in specific chunk sizes. This defaults to 8192 which is a sane number to use most of the time (change the default with JStream::set('chunksize', newsize);) Note: This doesn't support gzip/bzip2 writing like reading does
chmod chmod wrapper
get_meta_data Get the stream metadata http://au.php.net/manual/en/function.stream-get-meta-data.php

array header/metadata

setContextOptions Updates the context to the array Format is the same as the options for stream_context_create
addContextEntry Adds a particular options to the context
deleteContextEntry Deletes a particular setting from a context
applyContextToStream Applies the current context to the stream Use this to change the values of the context after you've opened a stream
appendFilter Append a filter to the chain
prependFilter
removeFilter Remove a filter, either by resource (handed out from the append or prepend function alternatively via getting the filter list) bool Result of operation
copy Copy a file from src to dest
move Moves a file
delete Delete a file
upload Upload a file
writeFile Writes a chunk of data to a file
getFileHandle Return the internal file handle

Importing

jimport( 'joomla.filesystem.stream' );

[Edit See Also] SeeAlso:JStream

Examples

<CodeExamplesForm />