     }
 }
 
+public enum FileType: UInt16 {
+    case Invalid = 0
+    case FIFO = 1
+    case CharacterDevice = 2
+    case Directory = 4
+    case BlockDevice = 6
+    case File = 8
+    case Symlink = 10
+    case Socket = 12
+    case Whiteout = 14
+
+    private init?(statMode: UInt16) {
+        self.init(rawValue: (statMode & 0xf000) >> 12)
+    }
+}
+
 /// File information
 public struct FileInfo {
 

    /// file size
    let size: UInt64

    /// is this a directory
    let isDir: Bool

    /// is this a symlink
    let isLink: Bool

    /// path to original if this is a symlink
    let linkTarget: Path?


/// UNIX File mode
public struct FileMode: OptionSet {
    public let rawValue: UInt16

    public static let Inaccessible = FileMode(rawValue: 0)

