Effortless path operations in Swift.
letpath=Path("/usr/bin/swift")letpath=Path("/usr/bin")+ Path("swift")path.isAbsolutepath.isRelativepath.exists()path.isDirectory()letabsolutePath= path.absolute()This cleans up any redundant .. or . and double slashes in paths.
letnormalizedPath= path.normalize()path.delete()path.move(newPath)Path.current Path.current ="/usr/bin"path.chdir{ // Path.current would be set to path during execution of this closure }path.children()path.read()path.write("Hello World!")letpaths=Path.glob("*.swift")Kyle Fuller
PathKit is licensed under the BSD License.