getFileSize() 공개 정적인 메소드

Get the size of a file in the specified unit.
public static getFileSize ( string $pathToFile, string $unit = 'B' ) : float | null
$pathToFile string
$unit string eg 'B' for Byte, 'KB', 'MB', 'GB', 'TB'.
리턴 float | null Returns null if file does not exist or the size of the file in the specified unit
예제 #1
0
 public function isAbnormal()
 {
     $size = Filesystem::getFileSize($this->tmpFile, 'MB');
     return $size !== null && $size >= 100;
 }
예제 #2
0
파일: Process.php 프로젝트: diosmosis/piwik
 private function pidFileSizeIsNormal()
 {
     $size = Filesystem::getFileSize($this->pidFile);
     return $size !== null && $size < 500;
 }
예제 #3
0
 public function test_getFileSize_ShouldReturnNull_IfFileDoesNotExists()
 {
     $size = Filesystem::getFileSize(PIWIK_INCLUDE_PATH . '/tests/NotExisting.File');
     $this->assertNull($size);
 }
예제 #4
0
 public function test_getFileSize_ShouldReturnNull_IfFileDoesNotExists()
 {
     File::setFileExists(false);
     $size = Filesystem::getFileSize(__FILE__);
     $this->assertNull($size);
 }