Is there a *nix command or C api that will tell the type of the storage device given the path to the file (resolving the mounts, symlinks, etc)? I need to find out whether the file lives on a removable device.
I don't know whether find is sufficient to reveal the storage device:
from the manpage:
Another idea is 'stat'
There is a line 'Device:' but I don*t know what to do about it. Maybe you find out?
|show 2 more comments|
Some *nix implementations might have a cool tool, but it wouldn't be too hard to use mount(1) output to correlate a file and its filesystem:
Giveaways in the mount name aside, any file I find under /media/WINXP_PRO_SP1 has go to be on the DVD-ROM.