mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: Two separate types for representing file paths currently exist: [`SystemPackage`'s `FilePath`](https://swiftpackageindex.com/apple/swift-system/1.6.0/documentation/systempackage/filepath) type and [`System`'s `FilePath`](https://developer.apple.com/documentation/system/filepath) type. `NIOFileSystem` currently uses `SystemPackage`'s `FilePath`. However, the lack of an API for converting between the two representations means that users whose application also uses `System.FilePath` may find interacting with `NIOFileSystem` difficult. Modifications: - Added `NIOFilePath`, and its subcomponents `NIOFilePath.Root`, `NIOFilePath.Component`, and `NIOFilePath.ComponentView`. - These types mirror the API of `SystemPackage`'s `FilePath` and are internally backed by it. - `NIOFilePath` can be initialized from either an instance of `SystemPackage.FilePath` or `System.FilePath`. Result: Reduces the friction of interacting with `NIOFileSystem` by providing a bridge between `SystemPackage.FilePath` and `System.FilePath`. --------- Co-authored-by: George Barnett <gbarnett@apple.com>