Fix stat call on Linux

stat on Linux has completely different flags than stat on Mac.
Merge pull request #1 from binji/stat-linux

Fix stat call on Linux