EmptyIterator::valid
FilesystemIterator::__construct
Iterators
PHP Manual

# The FilesystemIterator class

(PHP 5 >= 5.3.0)

## Introdução

The Filesystem iterator

## Sinopse da classe

FilesystemIterator extends DirectoryIterator implements SeekableIterator {
/* Constantes */
const integer CURRENT_AS_PATHNAME = 32 ;
const integer CURRENT_AS_FILEINFO = 0 ;
const integer CURRENT_AS_SELF = 16 ;
const integer CURRENT_MODE_MASK = 240 ;
const integer KEY_AS_PATHNAME = 0 ;
const integer KEY_AS_FILENAME = 256 ;
const integer FOLLOW_SYMLINKS = 512 ;
const integer KEY_MODE_MASK = 3840 ;
const integer NEW_CURRENT_AND_KEY = 256 ;
const integer SKIP_DOTS = 4096 ;
const integer UNIX_PATHS = 8192 ;
/* Métodos */
public __construct ( string `$path` [, int `$flags` = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS ] )
public mixed current ( void )
public int getFlags ( void )
public string key ( void )
public void next ( void )
public void rewind ( void )
public void setFlags ([ int `$flags` ] )
/* Métodos herdados */
DirectoryIterator DirectoryIterator::current ( void )
int DirectoryIterator::getATime ( void )
public string DirectoryIterator::getBasename ([ string `$sufixo` ] )
int DirectoryIterator::getCTime ( void )
public string DirectoryIterator::getExtension ( void )
string DirectoryIterator::getFilename ( void )
int DirectoryIterator::getGroup ( void )
int DirectoryIterator::getInode ( void )
int DirectoryIterator::getMTime ( void )
int DirectoryIterator::getOwner ( void )
string DirectoryIterator::getPath ( void )
string DirectoryIterator::getPathname ( void )
int DirectoryIterator::getPerms ( void )
int DirectoryIterator::getSize ( void )
string DirectoryIterator::getType ( void )
bool DirectoryIterator::isDir ( void )
bool DirectoryIterator::isDot ( void )
bool DirectoryIterator::isExecutable ( void )
bool DirectoryIterator::isFile ( void )
bool DirectoryIterator::isLink ( void )
bool DirectoryIterator::isReadable ( void )
bool DirectoryIterator::isWritable ( void )
string DirectoryIterator::key ( void )
void DirectoryIterator::next ( void )
void DirectoryIterator::rewind ( void )
public void DirectoryIterator::seek ( int `$posicao` )
public string DirectoryIterator::__toString ( void )
string DirectoryIterator::valid ( void )
}

## Constantes pré-definidas

`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::SKIP_DOTS`

  Skips dot files (. and ..).

`FilesystemIterator::UNIX_PATHS`

  Makes paths use Unix-style forward slash irrespective of system default.

## Changelog

Versão | Descrição
--- | ---
5.3.1 | Added `FilesystemIterator::FOLLOW_SYMLINKS`

## Índice

- FilesystemIterator::__construct — Constructs a new filesystem iterator
- FilesystemIterator::current — The current file
- FilesystemIterator::getFlags — Get the handling flags
- FilesystemIterator::key — Retrieve the key for the current file
- FilesystemIterator::next — Move to the next file
- FilesystemIterator::rewind — Rewinds back to the beginning
- FilesystemIterator::setFlags — Sets handling flags

EmptyIterator::valid
FilesystemIterator::__construct
Iterators
PHP Manual