Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!rutgers!ucsd!sdcsvax!ucsdhub!esosun!seismo!uunet!vsi!friedl From: friedl@vsi.UUCP (Stephen J. Friedl) Newsgroups: comp.unix.questions Subject: Re: Determining if a given path is a file system. Summary: Please include a return address... Message-ID: <744@vsi.UUCP> Date: 5 Jul 88 03:30:00 GMT References: <16377@brl-adm.ARPA> Organization: V-Systems, Inc. -- Santa Ana, CA Lines: 33 In article <16377@brl-adm.ARPA>, PETERS%MSSTATE.BITNET@cunyvm.cuny.edu (Frank Peters) writes: < Please forgive what is probably a childishly simple question. < < Given a complete path, how do I determine if that path identifies < the mount point of a file system (from within a C program). So < far the only solution I can find is to read the system mount < table. It seems as if there should be a simpler way but I can't < seem to find one in my programmer reference manual. < < Thanks in advance for any help. Please send replies to me and I < will summarize to the list if interest warrents. < < Frank Peters It would really help if those requesting email responses would include an email address. My knowledge of UNIX questions is much better than my knowledge of the various network addressing schemes, and my history of successful [R]eplies to paths that include all of @ % . ! and BITNET is very poor. Hey, short .signatures are nice, but... :-) To answer the question (while I'm at it), stat the full path, then stat path/.. and see if st_dev is different. If they are, it's a mount point. Disclaimer: I don't know how this works for network mounts (NFS or RFS or whatever). Steve -- Steve Friedl V-Systems, Inc. (714) 545-6442 3B2-kind-of-guy friedl@vsi.com {backbones}!vsi.com!friedl attmail!vsi!friedl -----------Nancy Reagan on John DeLorean: "Just say snow"----------