Skip to content

Commit

Permalink
Add exists property to FKPath
Browse files Browse the repository at this point in the history
  • Loading branch information
nvzqz committed Sep 7, 2015
1 parent 959b9b1 commit e8b3cd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion FileKit/Core/FKFileType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public extension FKFileType {

/// True if the file exists.
public var exists: Bool {
return NSFileManager.defaultManager().fileExistsAtPath(path.rawValue)
return path.exists
}

/// Creates the file.
Expand Down
5 changes: 5 additions & 0 deletions FileKit/Core/FKPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public struct FKPath: StringLiteralConvertible,
return !isAbsolute
}

/// Returns true if a file exists at the path.
public var exists: Bool {
return NSFileManager.defaultManager().fileExistsAtPath(_path)
}

/// Returns true if the path points to a directory.
public var isDirectory: Bool {
var isDirectory: ObjCBool = false
Expand Down

0 comments on commit e8b3cd7

Please sign in to comment.