Actually, the right way to check this is see whether the file name ends in a forward slash. You can see an implementation of this in the 7-Zip source code: https://github.com/mcmilk/7-Zip/blob/c44df79f9a65142c460313f720dc22c8783c63b1/CPP/7zip/Archive/Zip/ZipItem.cpp#L269
The "external file attributes" field is specific to the platform that created the zip file, so I wouldn't advise using it.