표준 PHP 라이브러리(SPL) The FilesystemIterator class

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


소개

파일 시스템 반복자


클래스 개요

                  
class FilesystemIterator extends DirectoryIterator {

  /* Constants */
  const int CURRENT_AS_PATHNAME = 32;
  const int CURRENT_AS_FILEINFO = 0;
  const int CURRENT_AS_SELF = 16;
  const int CURRENT_MODE_MASK = 240;
  const int KEY_AS_PATHNAME = 0;
  const int KEY_AS_FILENAME = 256;
  const int FOLLOW_SYMLINKS = 512;
  const int KEY_MODE_MASK = 3840;
  const int NEW_CURRENT_AND_KEY = 256;
  const int SKIP_DOTS = 4096;
  const int UNIX_PATHS = 8192;

  /* Methods */
  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

  /* Inherited methods */
  public DirectoryIterator::current(): mixed
  public DirectoryIterator::getATime(): int
  public DirectoryIterator::getBasename(string $suffix = ""): string
  public DirectoryIterator::getCTime(): int
  public DirectoryIterator::getExtension(): string
  public DirectoryIterator::getFilename(): string
  public DirectoryIterator::getGroup(): int
  public DirectoryIterator::getInode(): int
  public DirectoryIterator::getMTime(): int
  public DirectoryIterator::getOwner(): int
  public DirectoryIterator::getPath(): string
  public DirectoryIterator::getPathname(): string
  public DirectoryIterator::getPerms(): int
  public DirectoryIterator::getSize(): int
  public DirectoryIterator::getType(): string
  public DirectoryIterator::isDir(): bool
  public DirectoryIterator::isDot(): bool
  public DirectoryIterator::isExecutable(): bool
  public DirectoryIterator::isFile(): bool
  public DirectoryIterator::isLink(): bool
  public DirectoryIterator::isReadable(): bool
  public DirectoryIterator::isWritable(): 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
}
                  
                

미리 정의된 상수

FilesystemIterator::CURRENT_AS_PATHNAME
FilesystemIterator::current()가 경로 이름을 반환하도록 합니다.
FilesystemIterator::CURRENT_AS_FILEINFO
FilesystemIterator::current()SplFileInfo 인스턴스를 반환하도록 합니다.
FilesystemIterator::CURRENT_AS_SELF
FilesystemIterator::current()가 $this(FilesystemIterator)를 반환하도록 합니다.
FilesystemIterator::CURRENT_MODE_MASK
Masks FilesystemIterator::current()
FilesystemIterator::KEY_AS_PATHNAME
FilesystemIterator::key()가 경로 이름을 반환하도록 합니다.
FilesystemIterator::KEY_AS_FILENAME
FilesystemIterator::key()가 파일 이름을 반환하도록 합니다.
RecursiveDirectoryIterator::hasChildren()이 심볼릭 링크를 따르도록 합니다.
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
점 파일(...)을 건너뜁니다.
FilesystemIterator::UNIX_PATHS
시스템 기본값에 관계없이 경로가 Unix 스타일의 슬래시를 사용하도록 합니다. 생성자에 전달된 path는 수정되지 않습니다.

목차