| @@ 187-196 (lines=10) @@ | ||
| 184 | * |
|
| 185 | * @return int the number of bytes in the file, or -1 on failure. |
|
| 186 | */ |
|
| 187 | public function length() |
|
| 188 | { |
|
| 189 | if (!$this->exists()) { |
|
| 190 | return -1; |
|
| 191 | } |
|
| 192 | ||
| 193 | return ($result = filesize($this->path)) !== false ? $result : -1; |
|
| 194 | } |
|
| 195 | ||
| 196 | /** |
|
| 197 | * Returns the time of the last modification as a unixtimestap, or -1 on failure. |
|
| 198 | * |
|
| 199 | * @return int the time of the last modification as a unixtimestap, or -1 on failure. |
|
| @@ 201-210 (lines=10) @@ | ||
| 198 | * |
|
| 199 | * @return int the time of the last modification as a unixtimestap, or -1 on failure. |
|
| 200 | */ |
|
| 201 | public function lastModified() |
|
| 202 | { |
|
| 203 | if (!$this->exists()) { |
|
| 204 | return -1; |
|
| 205 | } |
|
| 206 | ||
| 207 | return ($result = filemtime($this->path)) !== false ? $result : -1; |
|
| 208 | } |
|
| 209 | ||
| 210 | /** |
|
| 211 | * Returns an iterator with the files and directories in the current directory. |
|
| 212 | * |
|
| 213 | * @param bool $recursive = false |
|