| @@ 144-153 (lines=10) @@ | ||
| 141 | * |
|
| 142 | * @return int the number of bytes in the file, or -1 on failure. |
|
| 143 | */ |
|
| 144 | public function count() |
|
| 145 | { |
|
| 146 | // Check if the file exists |
|
| 147 | if (!$this->exists()) { |
|
| 148 | return -1; |
|
| 149 | } |
|
| 150 | ||
| 151 | // Return length |
|
| 152 | return ($result = filesize($this->path)) !== false ? $result : -1; |
|
| 153 | } |
|
| 154 | ||
| 155 | /** |
|
| 156 | * Returns the time of the last modification as a unixtimestap, or -1 on failure. |
|
| @@ 160-169 (lines=10) @@ | ||
| 157 | * |
|
| 158 | * @return int the time of the last modification as a unixtimestap, or -1 on failure. |
|
| 159 | */ |
|
| 160 | public function lastModified() |
|
| 161 | { |
|
| 162 | // Check if the file exists |
|
| 163 | if (!$this->exists()) { |
|
| 164 | return -1; |
|
| 165 | } |
|
| 166 | ||
| 167 | // Return last modified timestamp |
|
| 168 | return ($result = filemtime($this->path)) !== false ? $result : -1; |
|
| 169 | } |
|
| 170 | ||
| 171 | /** |
|
| 172 | * Returns an iterator with the files and directories in the current directory. |
|