# A classe FilesystemIterator

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

## Introdução

O iterador do sistema de arquivos

## Resumo da 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étodos */
public function __construct(string `$directory`, int `$flags` = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS)
public function current(): string|SplFileInfo|FilesystemIterator
public function getFlags(): int
public function key(): string
public function next(): void
public function rewind(): void
public function setFlags(int `$flags`): void
/* Métodos herdados */
public function DirectoryIterator::current(): mixed
public function DirectoryIterator::getBasename(string `$suffix` = ""): string
public function DirectoryIterator::getExtension(): string
public function DirectoryIterator::getFilename(): string
public function DirectoryIterator::isDot(): bool
public function DirectoryIterator::key(): mixed
public function DirectoryIterator::next(): void
public function DirectoryIterator::rewind(): void
public function DirectoryIterator::seek(int `$offset`): void
public function DirectoryIterator::__toString(): string
public function DirectoryIterator::valid(): bool
public function SplFileInfo::getATime(): int|false
public function SplFileInfo::getBasename(string `$suffix` = ""): string
public function SplFileInfo::getCTime(): int|false
public function SplFileInfo::getExtension(): string
public function SplFileInfo::getFileInfo(?string `$class` = `null`): SplFileInfo
public function SplFileInfo::getFilename(): string
public function SplFileInfo::getGroup(): int|false
public function SplFileInfo::getInode(): int|false
public function SplFileInfo::getLinkTarget(): string|false
public function SplFileInfo::getMTime(): int|false
public function SplFileInfo::getOwner(): int|false
public function SplFileInfo::getPath(): string
public function SplFileInfo::getPathInfo(?string `$class` = `null`): ?SplFileInfo
public function SplFileInfo::getPathname(): string
public function SplFileInfo::getPerms(): int|false
public function SplFileInfo::getRealPath(): string|false
public function SplFileInfo::getSize(): int|false
public function SplFileInfo::getType(): string|false
public function SplFileInfo::isDir(): bool
public function SplFileInfo::isExecutable(): bool
public function SplFileInfo::isFile(): bool
public function SplFileInfo::isLink(): bool
public function SplFileInfo::isReadable(): bool
public function SplFileInfo::isWritable(): bool
public function SplFileInfo::openFile(string `$mode` = "r", bool `$useIncludePath` = `false`, ?resource `$context` = `null`): SplFileObject
public function SplFileInfo::setFileClass(string `$class` = `SplFileObject::class`): void
public function SplFileInfo::setInfoClass(string `$class` = `SplFileInfo::class`): void
public function SplFileInfo::__toString(): string
}

## Constantes predefinidas

`FilesystemIterator::CURRENT_AS_PATHNAME`

  Faz com que FilesystemIterator::current() retorne o pathname.

`FilesystemIterator::CURRENT_AS_FILEINFO`

  Faz com que FilesystemIterator::current() retorne uma instância SplFileInfo.

`FilesystemIterator::CURRENT_AS_SELF`

  Faz com que FilesystemIterator::current() retorne $this (o FilesystemIterator).

`FilesystemIterator::CURRENT_MODE_MASK`

  Máscara para FilesystemIterator::current()

`FilesystemIterator::KEY_AS_PATHNAME`

  Faz com que FilesystemIterator::key() retorne o pathname.

`FilesystemIterator::KEY_AS_FILENAME`

  Faz com que FilesystemIterator::key() retorne o filename.

`FilesystemIterator::FOLLOW_SYMLINKS`

  Faz com que RecursiveDirectoryIterator::hasChildren() siga os links simbólicos.

`FilesystemIterator::KEY_MODE_MASK`

  Máscara para FilesystemIterator::key()

`FilesystemIterator::NEW_CURRENT_AND_KEY`

  Mesmo que `FilesystemIterator::KEY_AS_FILENAME | FilesystemIterator::CURRENT_AS_FILEINFO`.

`FilesystemIterator::OTHER_MODE_MASK`

  Máscara usada para FilesystemIterator::getFlags() e FilesystemIterator::setFlags().

`FilesystemIterator::SKIP_DOTS`

  Pula os arquivos de ponto (`.` e `..`).

`FilesystemIterator::UNIX_PATHS`

  Faz com que os caminhos usem barra inclinada no estilo Unix, independentemente do padrão do sistema. Observe que o `path` passado ao construtor não é modificado.

## Índice

- FilesystemIterator::__construct — Constrói um novo iterador de sistema de arquivos
- FilesystemIterator::current — O arquivo atual
- FilesystemIterator::getFlags — Obtem as opções de manipulação
- FilesystemIterator::key — Recupera a chave para o arquivo atual
- FilesystemIterator::next — Move para o próximo arquivo
- FilesystemIterator::rewind — Retrocede para o início
- FilesystemIterator::setFlags — Define opções de manipulação

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open