The FilesystemIterator class

Introduction

The Filesystem iterator

Class synopsis

FilesystemIterator
extends DirectoryIterator
/* Constants */
public const int FilesystemIterator::CURRENT_MODE_MASK;
public const int FilesystemIterator::CURRENT_AS_PATHNAME;
public const int FilesystemIterator::CURRENT_AS_FILEINFO;
public const int FilesystemIterator::CURRENT_AS_SELF;
public const int FilesystemIterator::KEY_MODE_MASK;
public const int FilesystemIterator::KEY_AS_PATHNAME;
public const int FilesystemIterator::FOLLOW_SYMLINKS;
public const int FilesystemIterator::KEY_AS_FILENAME;
public const int FilesystemIterator::NEW_CURRENT_AND_KEY;
public const int FilesystemIterator::OTHER_MODE_MASK;
public const int FilesystemIterator::SKIP_DOTS;
public const int FilesystemIterator::UNIX_PATHS;
/* Methods */
public FilesystemIterator::__construct(string $directory, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS)
public stringSplFileInfoFilesystemIterator FilesystemIterator::current()
public int FilesystemIterator::getFlags()
public string FilesystemIterator::key()
public void FilesystemIterator::next()
public void FilesystemIterator::rewind()
public void FilesystemIterator::setFlags(int $flags)
/* Inherited methods */
public mixed current()
public string getBasename(string $suffix = "")
public string getExtension()
public string getFilename()
public bool isDot()
public mixed key()
public void next()
public void rewind()
public void seek(int $offset)
public string __toString()
public bool valid()
public intfalse SplFileInfo::getATime()
public string SplFileInfo::getBasename(string $suffix = "")
public intfalse SplFileInfo::getCTime()
public string SplFileInfo::getExtension()
public SplFileInfo SplFileInfo::getFileInfo(stringnull $class = null)
public string SplFileInfo::getFilename()
public intfalse SplFileInfo::getGroup()
public intfalse SplFileInfo::getInode()
public stringfalse SplFileInfo::getLinkTarget()
public intfalse SplFileInfo::getMTime()
public intfalse SplFileInfo::getOwner()
public string SplFileInfo::getPath()
public SplFileInfonull SplFileInfo::getPathInfo(stringnull $class = null)
public string SplFileInfo::getPathname()
public intfalse SplFileInfo::getPerms()
public stringfalse SplFileInfo::getRealPath()
public intfalse SplFileInfo::getSize()
public stringfalse SplFileInfo::getType()
public bool SplFileInfo::isDir()
public bool SplFileInfo::isExecutable()
public bool SplFileInfo::isFile()
public bool SplFileInfo::isLink()
public bool SplFileInfo::isReadable()
public bool SplFileInfo::isWritable()
public SplFileObject SplFileInfo::openFile(string $mode = "r", bool $useIncludePath = false, resourcenull $context = null)
public void SplFileInfo::setFileClass(string $class = SplFileObject::class)
public void SplFileInfo::setInfoClass(string $class = SplFileInfo::class)
public string SplFileInfo::__toString()

Predefined Constants

FilesystemIterator::CURRENT_AS_PATHNAME

Makes FilesystemIterator::current return the pathname.

FilesystemIterator::CURRENT_AS_FILEINFO

Makes FilesystemIterator::current return an SplFileInfo instance.

FilesystemIterator::CURRENT_AS_SELF

Makes FilesystemIterator::current return $this (the FilesystemIterator).

FilesystemIterator::CURRENT_MODE_MASK

Masks FilesystemIterator::current

FilesystemIterator::KEY_AS_PATHNAME

Makes FilesystemIterator::key return the pathname.

FilesystemIterator::KEY_AS_FILENAME

Makes FilesystemIterator::key return the filename.

Makes RecursiveDirectoryIterator::hasChildren follow symlinks.

FilesystemIterator::KEY_MODE_MASK

Masks FilesystemIterator::key

FilesystemIterator::NEW_CURRENT_AND_KEY

Same as FilesystemIterator::KEY_AS_FILENAME | FilesystemIterator::CURRENT_AS_FILEINFO.

FilesystemIterator::OTHER_MODE_MASK

Mask used for FilesystemIterator::getFlags and FilesystemIterator::setFlags.

FilesystemIterator::SKIP_DOTS

Skips dot files (. and ..).

FilesystemIterator::UNIX_PATHS

Makes paths use Unix-style forward slash irrespective of system default. Note that the path that is passed to the constructor is not modified.

Table of Contents