Xref: utzoo comp.bugs.sys5:462 comp.unix.wizards:9205 Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!pacbell!att!mtunx!whuts!whutt!cher From: cher@whutt.UUCP (Mike Cherepov) Newsgroups: comp.bugs.sys5,comp.unix.wizards Subject: Re: crossing mount points (was find(1)) Summary: no need for full path Keywords: System V Release 3.1.1 Version 3 for AT&T 3B2 Message-ID: <3298@whutt.UUCP> Date: 9 Jun 88 15:58:54 GMT References: <479@uniq.UUCP> <681@labtam.OZ> <480@uniq.UUCP> <5747@chinet.UUCP> <482@uniq.UUCP> Organization: AT&T Bell Laboratories Lines: 15 # The only portable way I can think of to see if a file is remote or not # is to check the mount table in /etc/mnttab. Although not the official # kernel version of the mount table, it does contain a flag indicating that # a file system is remote. But that would be useful only if you have a # full path name and can then traverse down the tree and remember the last # time you passed a mount point and changed file systems (according to the # mnttab). Or you could implement in user code your own version of the # kernel namei() function. Excuse me, I'm not feeling well. # Roger Noe ihnp4!att!uniq!rjnoe You can tell that you have crossed a mount point by noting that st_dev has changed, - no need for the full path - then compare your st_dev with st_rdevs for the files in /etc/mnttab to tell whether you got a remote. Not very neat, but does beat the hell out of homespun namei. Mike Cherepov