At work our application runs on SOLARIS, LINUX, and Windows. I have been tasked with determining on startup if the system is being run across the network.
On Windows, this is simple, get the current working directory and throw it into the function PathIsNetworkPath.
Such a thing does not exist on UNIX systems, as far as I can tell. I see that using the function stat(), I can retrieve the device number that the file resides on (along with a bunch of other info). However, I have been unable to determine where this device is located (locally or remotely), and I have not been able to find a function that given a device number, returns true if remote and false if local...or something similar.
How can I determine if a particular directory or file lives on a remote machine? I can not have any network protocol checks...meaning, the function must succeed for all network filesystem protocols, it can't work for NFS and not for SMB for instance.
Thanks in advance!