>>552
もっと単純に考えるなら、外部コマンドで "ls -l" とかの結果から判別する。
これぐらいなら、Linux用のライブラリとかあるかもね。

↓ 参考として
ttp://www.hellohiro.com/command.htm