EmptyIterator::valid
FilesystemIterator::__construct
Iterators
PHP Manual

# The FilesystemIterator class

## Introdução

The Filesystem iterator

## Sinopse da classe

FilesystemIterator
FilesystemIterator extends DirectoryIterator implements SeekableIterator , Traversable , Iterator {
/* Constants */
const integer FilesystemIterator::CURRENT_AS_PATHNAME = 32 ;
const integer FilesystemIterator::CURRENT_AS_FILEINFO = 0 ;
const integer FilesystemIterator::CURRENT_AS_SELF = 16 ;
const integer FilesystemIterator::CURRENT_MODE_MASK = 240 ;
const integer FilesystemIterator::KEY_AS_PATHNAME = 0 ;
const integer FilesystemIterator::KEY_AS_FILENAME = 256 ;
const integer FilesystemIterator::KEY_MODE_MASK = 3840 ;
const integer FilesystemIterator::NEW_CURRENT_AND_KEY = 256 ;
const integer FilesystemIterator::SKIP_DOTS = 4096 ;
const integer FilesystemIterator::UNIX_PATHS = 8192 ;
/* Methods */
__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` ] )
/* Inherited methods */
DirectoryIterator DirectoryIterator::current ( void )
int DirectoryIterator::getATime ( void )
public string DirectoryIterator::getBasename ([ string `$suffix` ] )
int DirectoryIterator::getCTime ( 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 `$position` )
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::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.

## Í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