Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: notbob Newsgroups: comp.os.linux.misc Subject: Re: File real location Date: 26 Apr 2011 18:08:19 GMT Organization: ....little, if any Lines: 28 Message-ID: <91og0jFfucU15@mid.individual.net> References: <87pqo9apss.fsf@araminta.anjou.terraraq.org.uk> X-Trace: individual.net 6SiOT8mBHAfJT8jWVEWARAUapbvPqPw/43ftOe+/w7iyuFt5p0 Cancel-Lock: sha1:55PVHQzxBE/kq13GiWWHsNBG1OU= User-Agent: slrn/pre1.0.0-24 (Linux) Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.misc:925 On 2011-04-26, The Natural Philosopher wrote: > Richard Kettlewell wrote: >> JimR writes: >>> 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. >> > I bow to a superior solution... Ummm.... let's back up a bit. Nevermind I haven't a clue what stat() and st_dev are. If a "filesystem is not mounted", how could there be any root (/) dir? If the dir foo has not been mounted how can one put a file into a dir that doesn't exist ...in a filesystem that hasn't been mounted? Is there some editor ....cat, vi, emacs... that will create a filesystem and dir if a nonexistent dir/file is specified and doesn't exist? nb --confused