Xref: utzoo comp.unix.questions:13819 comp.unix.wizards:16351 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!columbia!cunixc!sethr From: sethr@cunixc.cc.columbia.edu (Seth Robertson) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: help in finding which machine a file is actually stored on Keywords: help Message-ID: <1539@cunixc.cc.columbia.edu> Date: 23 May 89 18:12:53 GMT References: <8204@thorin.cs.unc.edu> Reply-To: seth@ctr.columbia.edu (Seth Robertson) Organization: Columbia University Lines: 19 In article <8204@thorin.cs.unc.edu> sunj@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@ctr.columbia.edu