From mboxrd@z Thu Jan 1 00:00:00 1970 From: dexen deVries To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Date: Thu, 3 Feb 2011 15:35:12 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.37-rc6-18+; KDE/4.5.5; x86_64; ; ) References: <201102031245.33842.dexen.devries@gmail.com> <201102031444.40895.dexen.devries@gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201102031535.13027.dexen.devries@gmail.com> Subject: Re: [9fans] files vs. directories Topicbox-Message-UUID: aad96014-ead6-11e9-9d60-3106f5b1d025 On Thursday, February 03, 2011 03:15:29 pm roger peppe wrote: > 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 wrot= e: > >> > read(open("/foo")) returns byte stream under entry `foo' in the root > >> > object. > >> >=20 > >> > readdir("/foo") returns `bar' (and possibly others) -- entries in > >> > hierarchical section of object `/foo'. > >>=20 > >> there's no distinction between readdir and read in plan 9. > >=20 > > 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. >=20 > i don't think that helps you. >=20 > under plan 9, reading a directory is this: >=20 > translate(read(open(dir))) >=20 > i don't see how you can make read(open(dir)) return > something different. >=20 > oh yes, maintaining the usual semantics for cp becomes tricky. >=20 > mkdir z > cp x.c z >=20 > do i mean to write x.c to z itself, or to a new file within z? another gotcha would be: echo aaa > foo echo bbb > bar bind -a foo bar # or bind -b foo.txt bar.txt cat foo any sensible semantics possible? =2D-=20 dexen deVries [[[=E2=86=93][=E2=86=92]]] > how does a C compiler get to be that big? what is all that code doing? iterators, string objects, and a full set of C macros that ensure boundary conditions and improve interfaces. ron minnich, in response to Charles Forsyth http://9fans.net/archive/2011/02/90