# std::filesystem::directory_options

> C++ Atlas: `cppatlas.com/w/cpp/filesystem/directory_options` | Source: https://en.cppreference.com/w/cpp/filesystem/directory_options | Domain: Filesystem | Standards: C++17

This type represents available options that control the behavior of the directory_iterator and recursive_directory_iterator.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <filesystem>

enum class directory_options {
    none = /* unspecified */,
    follow_directory_symlink = /* unspecified */,
    skip_permission_denied = /* unspecified */
}; // (since C++17)
```

This type represents available options that control the behavior of the `directory_iterator` and `recursive_directory_iterator`.

`directory_options` satisfies the requirements of *BitmaskType* (which means the bitwise operators `operator&`, `operator|`, `operator^`, `operator~`, `operator&=`, `operator|=`, and `operator^=` are defined for this type). `none` represents the empty bitmask; every other enumerator represents a distinct bitmask element.

### Member constants

| Member constant | Meaning |
| --- | --- |
| `none` | (Default) Skip directory symlinks, permission denied is error. |
| `follow_directory_symlink` | Follow rather than skip directory symlinks. |
| `skip_permission_denied` | Skip directories that would otherwise result in permission denied errors. |

### Example

> Note: This section is incomplete Reason: no example

### See also

- [(constructor)](https://en.cppreference.com/w/cpp/filesystem/directory_iterator/directory_iterator): constructs a directory iterator (public member function of `std::filesystem::directory_iterator`)
- [(constructor)](https://en.cppreference.com/w/cpp/filesystem/recursive_directory_iterator/recursive_directory_iterator): constructs a recursive directory iterator (public member function of `std::filesystem::recursive_directory_iterator`)

---
Attribution: content from https://en.cppreference.com/w/cpp/filesystem/directory_options (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.