In a generic, modern unix environment (say, GNU/Linux, GNU/Solaris, or Mac OS X), is there a good way to determine which mountpoint and filesystem-type a particular absolute file path is on?
I suppose I could execute the mount
command and manually parse the output of that and string-compare it with my file path, but before I do that I'm wondering if there's a more elegant way.
I'm developing a BASH script that makes use of extended attributes, and want to make it Do The Right Thing (to the small extent that it is possible) for a variety of filesystems and host environments.