Since he mentioned NFS and Samba, I presumed that platform-specifity wasn't as much an issue as relying on external commands.
I agree that there is pretty much no way of accomplishing the given task reliably in a cross-platform manner. However "an OS with /proc filesystem support" is a much better qualifier than "an OS which has a 'mount' command that produces output in a specific format". So, using the mtab file is still better than using the output from mount.
The closest one could get to "cross-platform" would be checking the most likely OS targets to see which you are running under, and perform the logic that works for that OS. That's an unmaintainable curmudgeon, though.
--
$me = rand($hacker{perl});
All code, unless otherwise noted, is untested
| [reply] |