Merge pull request #9 from LucianoPAlmeida/is-path-conveniece-add

Adding convenience extensions on Path->Bool
This commit is contained in:
Max Howell
2019-01-20 19:28:05 -05:00
committed by GitHub

View File

@@ -6,6 +6,16 @@ public extension Path {
return FileManager.default.isWritableFile(atPath: string)
}
/// Returns true if the path represents an actual file that is also readable by the current user.
var isReadable: Bool {
return FileManager.default.isReadableFile(atPath: string)
}
/// Returns true if the path represents an actual file that is also deletable by the current user.
var isDeletable: Bool {
return FileManager.default.isDeletableFile(atPath: string)
}
/// Returns true if the path represents an actual directory.
var isDirectory: Bool {
var isDir: ObjCBool = false