I think your (stat $dir)[0] idea is fine. Another possibility is to use the -l file test. That still calls stat, so it's probably not any improvement.
You could evade all those stat calls by parsing mount points out of /etc/mtab or the system mount call, then matching paths. That seems messy and has possible inaccuracies, though.
After Compline,
Zaxo
In reply to Re: Filesystem checking
by Zaxo
in thread Filesystem checking
by coec
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |