---
title: FileManager.DirectoryEnumerator
framework: foundation
role: symbol
role_heading: Class
path: foundation/filemanager/directoryenumerator
---

# FileManager.DirectoryEnumerator

An object that enumerates the contents of a directory.

## Declaration

```swift
class DirectoryEnumerator
```

## Overview

Overview You obtain a directory enumerator using FileManager’s enumerator(atPath:) method. The enumeration provides the pathnames of all files and directories contained within that directory. These pathnames are relative to the directory. 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.

## Topics

### Getting File and Directory Attributes

- [directoryAttributes](foundation/filemanager/directoryenumerator/directoryattributes.md)
- [fileAttributes](foundation/filemanager/directoryenumerator/fileattributes.md)
- [level](foundation/filemanager/directoryenumerator/level.md)

### Skipping Subdirectories

- [skipDescendents()](foundation/filemanager/directoryenumerator/skipdescendents().md)
- [skipDescendants()](foundation/filemanager/directoryenumerator/skipdescendants().md)

### Instance Properties

- [isEnumeratingDirectoryPostOrder](foundation/filemanager/directoryenumerator/isenumeratingdirectorypostorder.md)

## Relationships

### Inherits From

- [NSEnumerator](foundation/nsenumerator.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSFastEnumeration](foundation/nsfastenumeration.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [Sequence](swift/sequence.md)

## See Also

### Discovering directory contents

- [contentsOfDirectory(at:includingPropertiesForKeys:options:)](foundation/filemanager/contentsofdirectory(at:includingpropertiesforkeys:options:).md)
- [contentsOfDirectory(atPath:)](foundation/filemanager/contentsofdirectory(atpath:).md)
- [enumerator(at:includingPropertiesForKeys:options:errorHandler:)](foundation/filemanager/enumerator(at:includingpropertiesforkeys:options:errorhandler:).md)
- [enumerator(atPath:)](foundation/filemanager/enumerator(atpath:).md)
- [mountedVolumeURLs(includingResourceValuesForKeys:options:)](foundation/filemanager/mountedvolumeurls(includingresourcevaluesforkeys:options:).md)
- [FileManager.VolumeEnumerationOptions](foundation/filemanager/volumeenumerationoptions.md)
- [subpathsOfDirectory(atPath:)](foundation/filemanager/subpathsofdirectory(atpath:).md)
- [subpaths(atPath:)](foundation/filemanager/subpaths(atpath:).md)
