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:
aryan-25andGeorge Barnett authored and GitHub committed 2025-08-11 17:29:02 +01:00
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