Closed otaviokz closed 8 years ago
Try this instead: if (entry.fileMode & S_IFDIR) != 0
In Swift, integers like fileMode
don't automatically convert to booleans for the if
statement. Hence you need the additional != 0
to convert it to boolean.
"if (entry.fileMode & S_IFDIR)" isn't accepted by the Swift compiler, get "Ambiguous reference to member &".
It's accepted by the compiler but, in Swift, "fileMode" returns "16877" when it's a directory. Printing S_IFDIR in debug console returns "16877".