Class

FileManager.DirectoryEnumerator

An NSDirectoryEnumerator object enumerates the contents of a directory, returning the pathnames of all files and directories contained within that directory. These pathnames are relative to the directory.

Overview

You obtain a directory enumerator using NSFileManager’s enumerator(atPath:) method. For more details, see Low-Level File Management Programming Topics.

An enumeration is recursive, including the files of all subdirectories, and crosses device boundaries. An enumeration does not resolve symbolic links, or attempt to traverse symbolic links that point to directories.

Symbols

Getting File and Directory Attributes

var directoryAttributes: [FileAttributeKey : Any]?

A dictionary with the attributes of the directory at which enumeration started.

var fileAttributes: [FileAttributeKey : Any]?

A dictionary with the attributes of the most recently returned file or subdirectory (as referenced by the pathname).

var level: Int

The number of levels deep the current object is in the directory hierarchy being enumerated.

Skipping Subdirectories

func skipDescendents()

Causes the receiver to skip recursion into the most recently obtained subdirectory.

func skipDescendants()

Causes the receiver to skip recursion into the most recently obtained subdirectory.

Relationships

Inherits From