getGuaka / FileUtils

Easy way to work with files, directories and paths in swift on macOS and linux.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Path.Type returns file for directory on OSX 10.11.6

wpuricz opened this issue · comments

Directory.contents is failing when passed a directory. This is happening because Path.Type returns .file when actually it should be returning .directory. I was able to fix it by adding || 16872 == st_mode to the end of the isDirectory property in the Constants.swift file.

fileprivate var isDirectory: Bool {
    return S_IFDIR == st_mode || 16877 == st_mode || 16893 == st_mode || 16872 == st_mode
  }

I did not test this on linux.

By the way, awesome library!

Please read this