From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Thu, 03 Feb 2011 12:45:33 +0100." <201102031245.33842.dexen.devries@gmail.com> References: <201102031245.33842.dexen.devries@gmail.com> From: Bakul Shah Date: Thu, 3 Feb 2011 08:58:58 -0800 Message-Id: <20110203165859.E501C5B66@mail.bitblocks.com> Subject: Re: [9fans] files vs. directories Topicbox-Message-UUID: aaf407d4-ead6-11e9-9d60-3106f5b1d025 On Thu, 03 Feb 2011 12:45:33 +0100 dexen deVries wrote: > > why do we keep distinction between files and directories? David Cheriton's `thoth' operating system didn't keep this distinction. But every other OS I know of keeps them separate. IIRC thoth provided functions for getting the first child or next sibing given a path name. [Cheriton used words like father, son, brother -- this was pre-PC!] > Does it provide any extra value over model with unified file/directory? They serve functions. A directory is an associative table, indexed by a string key. A file is an array, indexed by an integer. But most filesystems do store some attributes with a file thus breaking this simple model. One advantage of always storing a directory with a file is that you can represent file attributes via a directory. Then you can have an extensible attributes model. XML probably maps well to this model. Not sure doing so in plan9 makes any sense but you could build an experimental OS around it! But if you go this path, do consider providing a few more datatypes in the filesystem (integers, file-id, strings, ...). Basically persistent data types. Or just use an object or relational database as your filesystem. There are some uses for cloud based strings :-)