FileManager

extension FileManager
  • Change current directory to path for the duration of body, then return to previous directory.

    Throws

    ChangeDirectoryFailedError if directory change fails, rethrows errors from body

    Declaration

    Swift

    public func withCurrentDirectoryPath<Result>(_ path: String, body: () throws -> Result) throws -> Result

    Return Value

    the result of body