mirror of
https://github.com/apple/swift-nio
synced 2026-11-26 04:57:49 +00:00
Motivation: We accidentally removed the 'NIOFileSystem' module from the '_NIOFileSystem' product in the last release. Modifications: - Rename 'NIOFileSystem' and 'NIOFileSystemFoundationCompat' to 'NIOFS' and 'NIOFSFoundationCompat' - Add back 'NIOFileSystem' which re-exports '_NIOFileSystem' (there was no publicly available 'NIOFileSystemFoundationCompat' module to remove, only '_NIOFileSystemFoundationCompat'). Result: Fewer breaks
28 lines
875 B
Markdown
28 lines
875 B
Markdown
# ``NIOFileSystem/DirectoryFileHandleProtocol``
|
|
|
|
## Topics
|
|
|
|
### Iterating a directory
|
|
|
|
- ``listContents()``
|
|
|
|
### Opening files with managed lifecycles
|
|
|
|
Open files and directories at paths relative to the directory handle. These methods manage
|
|
the lifecycle of the handles by closing them when the `execute` closure returns.
|
|
|
|
- ``withFileHandle(forReadingAt:options:execute:)``
|
|
- ``withFileHandle(forWritingAt:options:execute:)``
|
|
- ``withFileHandle(forReadingAndWritingAt:options:execute:)``
|
|
- ``withDirectoryHandle(atPath:options:execute:)``
|
|
|
|
### Opening files
|
|
|
|
Open files and directories at paths relative to the directory handle. These methods return
|
|
the handle to the caller who is responsible for closing it.
|
|
|
|
- ``openFile(forReadingAt:options:)``
|
|
- ``openFile(forWritingAt:options:)``
|
|
- ``openFile(forReadingAndWritingAt:options:)``
|
|
- ``openDirectory(atPath:options:)``
|