         }
     }
 
-    var isDirectory:Bool {
+    public var isDirectory:Bool {
         return fileType == .Directory
     }
 
-    func iter(@noescape closure:Path -> Void) {
+    public func iter(@noescape closure:Path -> Void) {
         let enumerator = NSFileManager().enumeratorAtURL(url, includingPropertiesForKeys: nil, options: NSDirectoryEnumerationOptions.SkipsSubdirectoryDescendants, errorHandler: nil)
         for url in enumerator! {
             closure(Path(url as! NSURL))
         }
     }
 
-    var length:Int {
+    public var length:Int {
         return try! getAttributes()[NSFileSize] as! Int
     }
 

        return NSURL(fileURLWithPath: path)
    }

    var exists:Bool {
        return url.checkResourceIsReachableAndReturnError(nil)
    }

    func getAttributes() throws -> [String : AnyObject] {
        let attributes = try NSFileManager().attributesOfItemAtPath(path)
        return attributes
    }

    var fileType:FileType! {
        switch try! getAttributes()[NSFileType] as! String {
            case NSFileTypeDirectory:
                return .Directory


import Foundation

public struct Path {
    public let path:String
    public init(_ path:String) {
        self.path = path
    }

    public init(_ URL:NSURL) {
        self.path = URL.path!
    }
    public var url:NSURL {
        return NSURL(fileURLWithPath: path)
    }
}
