Discussion:
[9fans] Unintuitive mount behavior
(too old to reply)
a***@9srv.net
2013-04-09 20:56:12 UTC
Permalink
This came up in #plan9, and I reduced it to this example:

:; mkdir cat dog pig
:; echo meow > cat/tabby
:; echo woof > dog/mutt
:; bind cat pig
:; bind dog/mutt pig/tabby
:; cat cat/tabby
woof

That is not what I'd expect, and certainly not what the 9fan
originally asking the question expected. I presume this is
because the device and qid match, but can't track down
exactly where. Is this because the path from Qids, instead
of Chans, is being used in /sys/src/9/port/chan.c?

Anthony
Nemo
2013-04-09 21:05:06 UTC
Permalink
Post by a***@9srv.net
:; mkdir cat dog pig
:; echo meow > cat/tabby
:; echo woof > dog/mutt
:; bind cat pig
When you reach pig, you now jump to cat.
Post by a***@9srv.net
:; bind dog/mutt pig/tabby
You resolve pig/tabby before the bind, which means
cat/tabbly because of the bind
Post by a***@9srv.net
:; cat cat/tabby
woof
And there your are.

That's unless I'm too sleepy, of course.

I had problems with mount tables because I came from unix.
Here they are just "jump here to there", but it's hard to assume,
at least to me, because it's too simple for what I'd expect, perhaps.
Loading...