Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Tim Watts Newsgroups: comp.os.linux.misc Subject: Re: File real location Followup-To: comp.os.linux.misc Date: Tue, 26 Apr 2011 19:08:20 +0100 Organization: A noiseless patient Spider Lines: 27 Message-ID: References: <87pqo9apss.fsf@araminta.anjou.terraraq.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Info: mx02.eternal-september.org; posting-host="6oIlEBqCjOm0MjsSUEk5CA"; logging-data="30238"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19n6GsWXQ7ubY4UNrA5EnhILOkj6NYcqHY=" User-Agent: KNode/4.4.6 Cancel-Lock: sha1:/j6Jq4Zn+rZ12DER7S2teaEo344= Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.misc:926 Richard Kettlewell wrote: > JimR writes: > >> This applies to Unix as well as Linux, but has been bugging me for >> awhile. >> >> Supposed I have a filesystem that is optionally mounted. Let's says >> the mount point is >> /foo >> >> Now I create a file on it, let's call it bar. Now I have >> /foo/bar >> >> In an alternative case, the filesystem is not mounted. I can still >> create a file bar in the directory foo, but it will fall onto the >> default filesystem (likely root filesystem). >> >> How can I tell the difference between these 2 files, i.e., on which >> filesystem did the file land? > > stat() it and look at st_dev. > Wot he said ^ -- Tim Watts