Lines Matching refs:file
19 protected $file = ''; variable in VerboseTar
29 * @param string $file
33 public function open($file, $comptype = self::COMPRESS_AUTO) { argument
35 if($comptype == self::COMPRESS_AUTO) $comptype = $this->filetype($file);
39 $this->file = $file;
42 $this->fh = @gzopen($this->file, 'rb');
44 $this->fh = @bzopen($this->file, 'r');
46 $this->fh = @fopen($this->file, 'rb');
49 … if(!$this->fh) throw new VerboseTarIOException('Could not open file for reading: '.$this->file);
75 …if($this->closed || !$this->file) throw new VerboseTarIOException('Can not read from a closed arch…
116 …if($this->closed || !$this->file) throw new VerboseTarIOException('Can not read from a closed arch…
206 * @param string $file
212 public function create($file = '', $comptype = self::COMPRESS_AUTO, $complevel = 9) { argument
214 if($comptype == self::COMPRESS_AUTO) $comptype = $this->filetype($file);
218 $this->file = $file;
222 if($this->file) {
224 $this->fh = @gzopen($this->file, 'wb'.$complevel);
226 $this->fh = @bzopen($this->file, 'w');
228 $this->fh = @fopen($this->file, 'wb');
231 … if(!$this->fh) throw new VerboseTarIOException('Could not open file for writing: '.$this->file);
241 * @param string $file the original file
245 public function addFile($file, $name = '') { argument
248 if(!$name) $name = $file;
251 $fp = fopen($file, 'rb');
252 if(!$fp) throw new VerboseTarIOException('Could not open file for reading: '.$file);
255 clearstatcache(false, $file);
256 $stat = stat($file);
261 fileperms($file),
262 filesize($file),
263 filemtime($file)
328 if($this->file) {
337 $this->file = '';
371 public function save($file, $comptype = self::COMPRESS_AUTO, $complevel = 9) { argument
372 if($comptype === self::COMPRESS_AUTO) $comptype = $this->filetype($file);
374 if(!file_put_contents($file, $this->getArchive($comptype, $complevel))) {
375 throw new VerboseTarIOException('Could not write to file: '.$file);
403 if(!$this->file) {
451 $file = basename($name);
453 if(strlen($file) > 100 || strlen($dir) > 155) {
463 $name = $file;
579 * @param string $file
582 public function filetype($file) { argument
583 $file = strtolower($file);
584 if(substr($file, -3) == '.gz' || substr($file, -4) == '.tgz') {
586 } elseif(substr($file, -4) == '.bz2' || substr($file, -4) == '.tbz') {