Groups | Search | Server Info | Login | Register
Groups > comp.os.linux.misc > #929
| Newsgroups | comp.os.linux.misc |
|---|---|
| From | unruh <unruh@wormhole.physics.ubc.ca> |
| Subject | Re: File real location |
| References | <pkaj88-cg8.ln1@myleafnode.oneyv.org> <87pqo9apss.fsf@araminta.anjou.terraraq.org.uk> <ip6vck$hod$2@news.albasani.net> <91og0jFfucU15@mid.individual.net> |
| Message-ID | <slrnire4jf.ca5.unruh@wormhole.physics.ubc.ca> (permalink) |
| Date | 2011-04-26 18:43 +0000 |
On 2011-04-26, notbob <notbob@notbob.invalid> wrote: > On 2011-04-26, The Natural Philosopher <tnp@invalid.invalid> wrote: >> Richard Kettlewell wrote: >>> JimR <NotReallyMyEmail@example.net> 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? A mountpoint of a filesystem is a directory on another filesystem, often the so called root filesystem (because it contains the /directory). If the system is running at all it has a / filesystem already mounted. Now in the OP case, that contains a directory called /foo. That is just a regular directory, but on top of that directory (hiding anything which happens to be already in that directory) can be mounted another filesystem. Thus, contents of /foo can exist both on the original / filesystem and on the new mounted filesystem. If the mounted filesystem is actually mounted, all original contents of /foo on the / filesystem are inaccessible and hidden, until the new mounted filesystem is unmounted. > > nb --confused
Back to comp.os.linux.misc | Previous | Next — Previous in thread | Next in thread | Find similar
File real location JimR <NotReallyMyEmail@example.net> - 2011-04-26 13:06 -0400
Re: File real location Richard Kettlewell <rjk@greenend.org.uk> - 2011-04-26 18:24 +0100
Re: File real location The Natural Philosopher <tnp@invalid.invalid> - 2011-04-26 18:28 +0100
Re: File real location notbob <notbob@notbob.invalid> - 2011-04-26 18:08 +0000
Re: File real location Richard Kettlewell <rjk@greenend.org.uk> - 2011-04-26 19:14 +0100
Re: File real location Tim Watts <tw@dionic.net> - 2011-04-26 19:25 +0100
Re: File real location unruh <unruh@wormhole.physics.ubc.ca> - 2011-04-26 18:43 +0000
Re: File real location Chris Davies <chris-usenet@roaima.co.uk> - 2011-04-27 16:31 +0100
Re: File real location Tim Watts <tw@dionic.net> - 2011-04-26 19:08 +0100
Re: File real location JimR <NotReallyMyEmail@example.net> - 2011-04-26 14:43 -0400
Re: File real location Richard Kettlewell <rjk@greenend.org.uk> - 2011-04-26 20:28 +0100
Re: File real location JimR <NotReallyMyEmail@example.net> - 2011-04-26 17:00 -0400
Re: File real location The Natural Philosopher <tnp@invalid.invalid> - 2011-04-26 18:27 +0100
Re: File real location "Chris F.A. Johnson" <cfajohnson@gmail.com> - 2011-04-26 13:44 -0400
Re: File real location unruh <unruh@wormhole.physics.ubc.ca> - 2011-04-26 17:52 +0000
csiph-web