/** \return The opened path.
*/
function getPath() {
return $this->path;
}
/** \return The current file name.
*/
function getFileName() {
return $this->entry;
}
/** \return The current entries path and file name.
*/
function getPathName() {
return $this->getPath() . $this->getFileName();
}
/** \return The current entry's permissions.
*/
function getPerms() {
return fileperms($this->getPathName());
}
/** \return The current entry's inode.
*/
function getInode() {
return fileinode($this->getPathName());
}
/** \return The current entry's size in bytes .
*/
function getSize() {
return filesize($this->getPathName());
}
/** \return The current entry's owner name.
*/
function getOwner() {
return fileowner($this->getPathName());
}
/** \return The current entry's group name.
*/
function getGroup() {
return filegroup($this->getPathName());
}
/** \return The current entry's last access time.
*/
function getATime() {
return fileatime($this->getPathName());
}
/** \return The current entry's last modification time.
*/
function getMTime() {
return filemtime($this->getPathName());
}
/** \return The current entry's last change time.
*/
function getCTime() {
return filectime($this->getPathName());
}
/** \return The current entry's size in bytes .
*/
function getType() {
return filetype($this->getPathName());
}
/** \return Whether the current entry is writeable.
*/
function isWritable() {
return is_writable($this->getPathName());
}
/** \return Whether the current entry is readable.
*/
function isReadable() {
return is_readable($this->getPathName());
}
/** \return Whether the current entry is executable.
*/
function isExecutable() {
if (function_exists('is_executable')) {
return is_executable($this->getPathName());
}
}
/** \return Whether the current entry is .
*/
function isFile() {
return is_file($this->getPathName());
}
/** \return Whether the current entry is a directory.
*/
function isDir() {
return is_dir($this->getPathName());
}
/** \return Whether the current entry is either '.' or '..'.
*/
function isDot() {
return $this->isDir() && ($this->entry == '.' || $this->entry == '..');
}
/** \return whether the current entry is a link.
*/
function isLink() {
return is_link($this->getPathName());
}
/** \Move to next entry.
*/
function next() {
$this->valid = $this->getFile();
$this->key++;
}
/** \Rewind dir back to the start.
*/
function rewind() {
$this->key = 0;
rewinddir($this->handle);
$this->valid = $this->getFile();
}
/** \Check whether dir contains more entries.
*/
function valid() {
if ($this->valid === false) {
$this->close();
}
return $this->valid;
}
/** \Return current dir entry.
*/
function key() {
return $this->key;
}
/** \Return this.
*/
function current() {
return $this;
}
/** \Close dir.
*/
function close() {
closedir($this->handle);
}