コード例 #1
0
 /**
  * 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');
     }
 }
コード例 #2
0
ファイル: Zip.class.php プロジェクト: ZerGabriel/WCF
 /**
  * @see \wcf\system\io\File
  */
 public function __construct($filename)
 {
     parent::__construct($filename, 'rb');
 }
コード例 #3
0
ファイル: Zip.class.php プロジェクト: nick-strohm/WCF
 /**
  * @see	\wcf\system\io\File::__construct()
  */
 public function __construct($filename)
 {
     parent::__construct($filename, 'rb');
     $this->centralDirectory = $this->readCentralDirectory();
 }