---
title: "CFFileDescriptorInvalidate(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cffiledescriptorinvalidate(_:)"
---

# CFFileDescriptorInvalidate(_:)

Invalidates a CFFileDescriptor object.

## Declaration

```swift
func CFFileDescriptorInvalidate(_ f: CFFileDescriptor!)
```

## Parameters

- `f`: A CFFileDescriptor.

## Discussion

Discussion Once invalidated, the CFFileDescriptor object will no longer be read from or written to at the Core Fundation level. If you passed true for the closeOnInvalidate parameter when you called CFFileDescriptorCreate(_:_:_:_:_:), this function also closes the underlying file descriptor. If you passed false, you must close the descriptor yourself after invalidating the CFFileDescriptor object. important: You must invalidate the CFFileDescriptor before closing the underlying file descriptor.

## See Also

### Related Documentation

- [CFFileDescriptorGetNativeDescriptor(_:)](corefoundation/cffiledescriptorgetnativedescriptor(_:).md)
- [CFFileDescriptorIsValid(_:)](corefoundation/cffiledescriptorisvalid(_:).md)
