php8.5
Home/ Manual/ reference / spl/ The FilesystemIterator class

The FilesystemIterator class

The Filesystem iterator

Intro

The Filesystem iterator

Class synopsis

class FilesystemIterator extends DirectoryIterator { }

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.

FilesystemIterator::FOLLOW_SYMLINKS

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.

Changelog

VersionDescription

Filesystemiterator

In this section

Source: reference/spl/filesystemiterator.xml · from the official PHP manual (php/doc-en)