From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <201102031444.40895.dexen.devries@gmail.com> References: <201102031245.33842.dexen.devries@gmail.com> <201102031444.40895.dexen.devries@gmail.com> Date: Thu, 3 Feb 2011 14:15:29 +0000 Message-ID: From: roger peppe To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] files vs. directories Topicbox-Message-UUID: aab6abd2-ead6-11e9-9d60-3106f5b1d025 On 3 February 2011 13:44, dexen deVries wrote: > On Thursday, February 03, 2011 02:36:40 pm roger peppe wrote: >> On 3 February 2011 11:45, dexen deVries wrote: >> > read(open("/foo")) returns byte stream under entry `foo' in the root >> > object. >> > >> > readdir("/foo") returns `bar' (and possibly others) -- entries in >> > hierarchical section of object `/foo'. >> >> there's no distinction between readdir and read in plan 9. > > Forgot about that. Still, you can't chdir() into an inode that doesn't > indicate being a directory. And the bytestream returned by > read(SOME_DIRECTORY) is fixed-format and doesn't provide any space for free- > form bytestream. i don't think that helps you. under plan 9, reading a directory is this: translate(read(open(dir))) i don't see how you can make read(open(dir)) return something different. oh yes, maintaining the usual semantics for cp becomes tricky. mkdir z cp x.c z do i mean to write x.c to z itself, or to a new file within z?