/** * Opens a new file. The file is always opened in binary mode. * * @param string $filename */ public function __construct($filename) { $this->targetFilename = $filename; $i = 0; while (true) { try { parent::__construct(FileUtil::getTemporaryFilename('atomic_'), 'xb'); break; } catch (SystemException $e) { // allow at most 5 failures if (++$i === 5) { throw $e; } } } if (!flock($this->resource, LOCK_EX)) { throw new SystemException('Could not get lock on temporary file'); } }
/** * @see \wcf\system\io\File */ public function __construct($filename) { parent::__construct($filename, 'rb'); }
/** * @see \wcf\system\io\File::__construct() */ public function __construct($filename) { parent::__construct($filename, 'rb'); $this->centralDirectory = $this->readCentralDirectory(); }