Tidy up previous commit: - POSIX.1 might define the S_ISDIR() macro, but that doesn't   guarantee its existence...cope. - in the interest of compatibility, follow GHC's implementation of   Directory.getPermissions and classify everything that's not a   regular file (and non-executable) as searchable.
Tidy up previous commit:
- POSIX.1 might define the S_ISDIR() macro, but that doesn't
  guarantee its existence...cope.
- in the interest of compatibility, follow GHC's implementation of
  Directory.getPermissions and classify everything that's not a
  regular file (and non-executable) as searchable.

FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs