From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] using Tree* and File* vs imlementing own 9p-handling routines? In-Reply-To: Your message of "Thu, 08 Jan 2004 12:50:52 MST." From: "Russ Cox" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <90690.1073608648.1@t40.swtch.com> Message-Id: Date: Thu, 8 Jan 2004 19:37:28 -0500 Topicbox-Message-UUID: b46b35ee-eacc-11e9-9e20-41e7f4b1d025 > I'd like to have a comment from the 9p(2) man page clarified: > > In general, the File interface is appropriate for maintain- > ing arbitrary file trees (as in ramfs). The File interface > is best avoided when the tree structure is easily generated > as necessary; this is true when the tree is highly struc- > tured (as in cdfs and nntpfs) or is maintained elsewhere. > > Is there a penalty associated with using the File interface? It seems > to simplify greatly the implementation of 9p servers, so why should it > be avoided? the penalty is that the interface is slightly clunky and for things with easily generated structure i've found that using just the qid is easier than hanging an allocated structure off the aux in the File. the main overhead is code complexity. if your tree is fixed then Files are good. if your tree is a dynamic but regular structure then it's easier to avoid it.