Class SafeStream (namespace Nette\IO)
Thread safe / atomic file manipulation. Stream safe://
Public Method Summary | |
---|---|
static bool |
register
()
Registers protocol 'safe://'.
|
void |
stream_close
()
Closes file.
|
bool |
stream_eof
()
Returns TRUE if the file pointer is at end-of-file.
|
bool |
stream_open
(string $path, string $mode, int $options, string &$opened_path)
Opens file.
|
string |
stream_read
(int $length)
Reads up to length bytes from the file.
|
int |
stream_seek
(int $offset, int $whence)
Sets the file position indicator for the file.
|
array |
stream_stat
()
Gets information about a file referenced by $this->handle.
|
int |
stream_tell
()
Returns the position of the file.
|
int |
stream_write
(string $data)
Writes the string to the file.
|
bool |
unlink
(string $path)
Deletes a file.
|
array |
url_stat
(string $path, int $flags)
Gets information about a file referenced by filename.
|
Constant Summary | |||
---|---|---|---|
string | PROTOCOL |
'safe' |
line 44 Name of stream protocol - safe:// |
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 74 registerpublic static bool register () Registers protocol 'safe://'.
|
|||||||||||||||||||||
line 174 stream_closepublic void stream_close () Closes file.
|
|||||||||||||||||||||
line 243 stream_eofpublic bool stream_eof () Returns TRUE if the file pointer is at end-of-file.
|
|||||||||||||||||||||
line 90 stream_openpublic bool stream_open (string $path, string $mode, int $options, string &$opened_path) Opens file.
|
|||||||||||||||||||||
line 199 stream_readpublic string stream_read (int $length) Reads up to length bytes from the file.
|
|||||||||||||||||||||
line 257 stream_seekpublic int stream_seek (int $offset, int $whence) Sets the file position indicator for the file.
|
|||||||||||||||||||||
line 269 stream_statpublic array stream_stat () Gets information about a file referenced by $this->handle.
|
|||||||||||||||||||||
line 231 stream_tellpublic int stream_tell () Returns the position of the file.
|
|||||||||||||||||||||
line 212 stream_writepublic int stream_write (string $data) Writes the string to the file.
|
|||||||||||||||||||||
line 299 unlinkpublic bool unlink (string $path) Deletes a file. On Windows unlink is not allowed till file is opened
|
|||||||||||||||||||||
line 283 url_statpublic array url_stat (string $path, int $flags) Gets information about a file referenced by filename.
|