help in finding which machine a file is actually stored on

Seth Robertson sethr at cunixc.cc.columbia.edu
Wed May 24 04:12:53 AEST 1989


In article <8204 at thorin.cs.unc.edu> sunj at unc.cs.unc.edu (John Sun) writes:
>I need help some help in determining the actual machine a file is stored
>on.  What I am looking for is a routine that given an absolute file name
>returns the machine it is stored on in a NFS environment.  Is there a
>"system" call that does this?  If not, any pointers in helping me write
>such a routine would be appreciated.  Thanks!



Well, one way is to do a `df filename`

If df returns "machinename:directory" it's on machinename.
If df returns "directory" it's on the local machine.

It will follow symbolic links correctly and everything.


					-Seth
					 seth at ctr.columbia.edu



More information about the Comp.unix.questions mailing list