If the end of the file is reached, returns null If $length is not specified, reads up to the end of the file If $length is specified reads up to $length
Returns a writer that will start writing at the current pos in the source
Any data (from current file or any other file) located after current pos will be erased. No file will be erased though (so for file and directory readers, the file and directory will not be deleted) $this->close will be called. $this should not be used until the returned writer has been closed
Here is how to append a single file to an existing zip archive <sample> $archive = File_Archive::read('archive.zip/'); $file = File_Archive::read('foo.txt'); $file->extract($source->makeAppendWriter()); </sample>
Append the content of a tgz archive to an existing zip archive <sample> $archive = File_Archive::read('archive.zip/'); $file = File_Archive::read('archive.tgz/'); $file->extract($source->makeAppendWriter()); </sample>
seek The new writer will be opened seek bytes after the current position Seek can be positive or negative If current file pos + seek < 0 or current file pos + seek > current file size, we have an undefined behaviour