Should `FileDescriptor.closeAfter` provide a `FileDescriptor` to the invoked closure?
Open
- Dominant language
- Swift
- Stars
- 1.4k
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
I've been wanting to write something like
```swift
let foo = try FileDescriptor
.open("my-file", .readOnly)
.closeAfter { fileDescriptor in
/// do stuff with fileDescriptor
}
```
Contributor guide
Research direction
Start at the FileDescriptor.closeAfter API and inspect how it currently invokes its closure. Compare that behavior with the proposed closure receiving a FileDescriptor; done means the requested usage is supported while closeAfter retains its intended close-after behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100