From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20090128050202.GF7757@masters6.cs.jhu.edu> References: <20090128050202.GF7757@masters6.cs.jhu.edu> Date: Tue, 27 Jan 2009 21:37:58 -0800 Message-ID: Subject: Re: [9fans] Union mount directory behavior? From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 8b6694e2-ead4-11e9-9d60-3106f5b1d025 > term% ramfs -m /n/ram1 > term% ramfs -m /n/ram2 > term% bind /n/ram1 /n/ram > term% bind -a /n/ram2 /n/ram > term% mkdir /n/ram1/test > term% mkdir /n/ram2/test > term% touch /n/ram1/test/foo > term% touch /n/ram2/test/bar > term% ls -l /n/ram > d-rwxrwxr-x M 47 nwf nwf 0 Jan 27 23:55 /n/ram/test > d-rwxrwxr-x M 45 nwf nwf 0 Jan 27 23:55 /n/ram/test > term% ls -l /n/ram/test > --rw-rw-r-- M 45 nwf nwf 0 Jan 27 23:55 /n/ram/test/foo > term% cat /n/ram/test/bar > cat: can't open /n/ram/test/bar: '/n/ram/test/bar' does not exist > > Why don't I see /n/ram/test/bar? Unions are not recursive. You put two directories named test in /n/ram. Because of the -a on the second bind, the one from ram1 comes first. When you cd into test, you get the one from ram1. That one only contains foo. Russ