JStream/writeFile: Difference between revisions
From Joomla! Documentation
No edit summary |
m preparing for archive only |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
Writes a chunk of data to a file | Writes a chunk of data to a file | ||
===Syntax=== | ===Syntax=== | ||
| Line 46: | Line 44: | ||
</source> | </source> | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=writeFile | category=writeFile | ||
category=JStream | category=JStream | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
Latest revision as of 02:07, 25 March 2017
Description
Writes a chunk of data to a file
Syntax
writeFile($filename, &$buffer)
| Parameter Name | Default Value | Description |
|---|---|---|
| $filename | ||
| &$buffer |
Defined in
libraries/joomla/filesystem/stream.php
Importing
jimport( 'joomla.filesystem.stream' );
Source Body
function writeFile($filename, &$buffer)
{
if($this->open($filename, 'w'))
{
$result = $this->write($buffer);
$this->chmod();
$this->close();
return $result;
}
return false;
}
Examples
Code Examples