mirror of
https://github.com/apple/swift-nio
synced 2026-11-29 05:24:21 +00:00
Update FilePath references to NIOFilePath (#3333)
Motivation: Currently, file paths are represented by the `SystemPackage.FilePath` type in `NIOFileSystem`. Following from #3322, we want to use `NIOFilePath` instead. Modifications: This change provides `NIOFilePath` accepting/returning variants to all existing public methods that accept/return `SystemPackage.FilePath`. The bulk of the changes are in `FileSystemProtocol` and `FileHandleProtocol`, and their conforming types. The protocols have been modified to require `NIOFilePath` accepting/returning methods. Default implementations are provided for `SystemPackage.FilePath` accepting/returning methods---these call through to the `NIOFilePath` variants. Result: `NIOFilePath` path representations can now be used with the methods for interacting with the file system. --------- Co-authored-by: George Barnett <gbarnett@apple.com>
This commit is contained in:
1 parent
b881f6ec60
commit
8997a24524
20 files changed
+1387
-191
No files matched your search
@@ -11,10 +11,10 @@
|
||||
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:)``
|
||||
- ``withFileHandle(forReadingAt:options:execute:)-52xsn``
|
||||
- ``withFileHandle(forWritingAt:options:execute:)-36f0k``
|
||||
- ``withFileHandle(forReadingAndWritingAt:options:execute:)-5j0f3``
|
||||
- ``withDirectoryHandle(atPath:options:execute:)-2jszb``
|
||||
|
||||
### Opening files
|
||||
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
Files and directories can be opened and have their lifecycles managed by using the
|
||||
following methods:
|
||||
|
||||
- ``withFileHandle(forReadingAt:options:execute:)``
|
||||
- ``withFileHandle(forWritingAt:options:execute:)``
|
||||
- ``withFileHandle(forReadingAndWritingAt:options:execute:)``
|
||||
- ``withDirectoryHandle(atPath:options:execute:)``
|
||||
- ``withFileHandle(forReadingAt:options:execute:)-nsue``
|
||||
- ``withFileHandle(forWritingAt:options:execute:)-1p6ka``
|
||||
- ``withFileHandle(forReadingAndWritingAt:options:execute:)-9nqu3``
|
||||
- ``withDirectoryHandle(atPath:options:execute:)-4wzzz``
|
||||
|
||||
### Opening files
|
||||
|
||||
Files and directories can be opened using the following methods. The caller is responsible for
|
||||
closing it to avoid leaking resources.
|
||||
|
||||
- ``openFile(forReadingAt:)``
|
||||
- ``openFile(forReadingAt:)-6v2b8``
|
||||
- ``openFile(forWritingAt:options:)``
|
||||
- ``openFile(forReadingAndWritingAt:options:)``
|
||||
- ``openDirectory(atPath:options:)``
|
||||
@@ -33,8 +33,8 @@ closing it to avoid leaking resources.
|
||||
|
||||
### Managing files
|
||||
|
||||
- ``copyItem(at:to:shouldProceedAfterError:shouldCopyFile:)``
|
||||
- ``removeItem(at:)``
|
||||
- ``copyItem(at:to:strategy:shouldProceedAfterError:shouldCopyItem:)``
|
||||
- ``removeItem(at:)-1vii4``
|
||||
- ``moveItem(at:to:)``
|
||||
- ``replaceItem(at:withItemAt:)``
|
||||
- ``createDirectory(at:withIntermediateDirectories:permissions:)``
|
||||
@@ -43,4 +43,4 @@ closing it to avoid leaking resources.
|
||||
|
||||
- ``currentWorkingDirectory``
|
||||
- ``temporaryDirectory``
|
||||
- ``withTemporaryDirectory(prefix:options:execute:)``
|
||||
- ``withTemporaryDirectory(prefix:options:execute:)-rbkk``
|
||||
Reference in new issue
Block a user