# La classe FilesystemIterator

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

## Introduction

L'itérateur FilesystemIterator.

## Synopsis de la classe

class FilesystemIterator extends DirectoryIterator {
/* Constantes */
public const int CURRENT_MODE_MASK;
public const int CURRENT_AS_PATHNAME;
public const int CURRENT_AS_FILEINFO;
public const int CURRENT_AS_SELF;
public const int KEY_MODE_MASK;
public const int KEY_AS_PATHNAME;
public const int FOLLOW_SYMLINKS;
public const int KEY_AS_FILENAME;
public const int NEW_CURRENT_AND_KEY;
public const int OTHER_MODE_MASK;
public const int SKIP_DOTS;
public const int UNIX_PATHS;
/* Méthodes */
public __construct(string `$directory`, int `$flags` = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS)
public current(): string|SplFileInfo|FilesystemIterator
public getFlags(): int
public key(): string
public next(): void
public rewind(): void
public setFlags(int `$flags`): void
/* Méthodes héritées */
public DirectoryIterator::current(): mixed
public DirectoryIterator::getBasename(string `$suffix` = ""): string
public DirectoryIterator::getExtension(): string
public DirectoryIterator::getFilename(): string
public DirectoryIterator::isDot(): bool
public DirectoryIterator::key(): mixed
public DirectoryIterator::next(): void
public DirectoryIterator::rewind(): void
public DirectoryIterator::seek(int `$offset`): void
public DirectoryIterator::__toString(): string
public DirectoryIterator::valid(): bool
public SplFileInfo::getATime(): int|false
public SplFileInfo::getBasename(string `$suffix` = ""): string
public SplFileInfo::getCTime(): int|false
public SplFileInfo::getExtension(): string
public SplFileInfo::getFileInfo(?string `$class` = `null`): SplFileInfo
public SplFileInfo::getFilename(): string
public SplFileInfo::getGroup(): int|false
public SplFileInfo::getInode(): int|false
public SplFileInfo::getLinkTarget(): string|false
public SplFileInfo::getMTime(): int|false
public SplFileInfo::getOwner(): int|false
public SplFileInfo::getPath(): string
public SplFileInfo::getPathInfo(?string `$class` = `null`): ?SplFileInfo
public SplFileInfo::getPathname(): string
public SplFileInfo::getPerms(): int|false
public SplFileInfo::getRealPath(): string|false
public SplFileInfo::getSize(): int|false
public SplFileInfo::getType(): string|false
public SplFileInfo::isDir(): bool
public SplFileInfo::isExecutable(): bool
public SplFileInfo::isFile(): bool
public SplFileInfo::isLink(): bool
public SplFileInfo::isReadable(): bool
public SplFileInfo::isWritable(): bool
public SplFileInfo::openFile(string `$mode` = "r", bool `$useIncludePath` = `false`, ?resource `$context` = `null`): SplFileObject
public SplFileInfo::setFileClass(string `$class` = SplFileObject::class): void
public SplFileInfo::setInfoClass(string `$class` = SplFileInfo::class): void
public SplFileInfo::__toString(): string
}

## Constantes pré-définies

`FilesystemIterator::CURRENT_AS_PATHNAME`

  FilesystemIterator::current() retourne le nom du chemin.

`FilesystemIterator::CURRENT_AS_FILEINFO`

  FilesystemIterator::current() retourne un objet SplFileInfo.

`FilesystemIterator::CURRENT_AS_SELF`

  FilesystemIterator::current() retourne `$this` (le FilesystemIterator).

`FilesystemIterator::CURRENT_MODE_MASK`

  Masque FilesystemIterator::current().

`FilesystemIterator::KEY_AS_PATHNAME`

  FilesystemIterator::key() retourne le nom de chemin.

`FilesystemIterator::KEY_AS_FILENAME`

  FilesystemIterator::key() retourne le nom du fichier.

`FilesystemIterator::FOLLOW_SYMLINKS`

  Makes RecursiveDirectoryIterator::hasChildren() follow symlinks.

`FilesystemIterator::KEY_MODE_MASK`

  Masque FilesystemIterator::key().

`FilesystemIterator::NEW_CURRENT_AND_KEY`

  Identique à `FilesystemIterator::KEY_AS_FILENAME | FilesystemIterator::CURRENT_AS_FILEINFO`.

`FilesystemIterator::OTHER_MODE_MASK`

  Masque utilisé pour FilesystemIterator::getFlags() et FilesystemIterator::setFlags().

`FilesystemIterator::SKIP_DOTS`

  Ignore les fichiers points (`.` et `..`).

`FilesystemIterator::UNIX_PATHS`

  Les chemins utilisent le séparateur de dossier de type Unix, soit le slash, indépendamment du système de fonctionnement. Notez que le `chemin` qui est passé au constructeur n'est pas modifié.

## Sommaire

- FilesystemIterator::__construct — Construit un objet FilesystemIterator
- FilesystemIterator::current — Lit le fichier courant
- FilesystemIterator::getFlags — Lit les options activées
- FilesystemIterator::key — Lit le nom du fichier
- FilesystemIterator::next — Passe au fichier suivant
- FilesystemIterator::rewind — Recommence à lire le dossier
- FilesystemIterator::setFlags — Configure les options