From 7be264a38e2f07548fd606907795e7856ebde5cf Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Sun, 20 Jan 2019 22:13:13 -0200 Subject: [PATCH] Adding convenience extensions on Path->Bool --- Sources/Path->Bool.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/Path->Bool.swift b/Sources/Path->Bool.swift index 874cf21..f342703 100644 --- a/Sources/Path->Bool.swift +++ b/Sources/Path->Bool.swift @@ -5,6 +5,16 @@ public extension Path { var isWritable: Bool { 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 {