S_IFDIR not portable?