---
title: close()
framework: system
role: symbol
role_heading: Instance Method
path: system/filedescriptor/close()
---

# close()

Deletes a file descriptor.

## Declaration

```swift
func close() throws
```

## Mentioned in

Adopting Swift File Operations

## Discussion

Discussion Deletes the file descriptor from the per-process object reference table. If this is the last reference to the underlying object, the object will be deactivated. The corresponding C function is close.

## See Also

### Closing a File

- [closeAfter(_:)](system/filedescriptor/closeafter(_:).md)
