---
title: directory
framework: system
role: symbol
role_heading: Type Property
path: system/filedescriptor/openoptions/directory
---

# directory

Indicates that opening the file only succeeds if the file is a directory.

## Declaration

```swift
static var directory: FileDescriptor.OpenOptions { get }
```

## Discussion

Discussion If you specify this option and the file path you pass to doc:FileDescriptor/open(_:_:options:permissions:retryOnInterrupt:)-2266j is a not a directory, then that open operation fails. The corresponding C constant is O_DIRECTORY.
