From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200603152240.k2FMeCc00983@zamenhof.cs.utwente.nl> To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] tcl 9p support? (via tcl vfs?) In-reply-to: Your message of "Sat, 11 Mar 2006 11:06:57 -0600." References: <200603110911.k2B9BY708977@zamenhof.cs.utwente.nl> From: Axel Belinfante MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <979.1142462412.1@zamenhof.cs.utwente.nl.cs.utwente.nl> Date: Wed, 15 Mar 2006 23:40:12 +0100 Topicbox-Message-UUID: 1443d9ae-ead1-11e9-9d60-3106f5b1d025 eric responded to my question: > > Only recently I discovered that there is vfs support in tcl. > > Any informed opinions on how involved it would be to extend > > it with 9p support? > > A 9P server library in tcl is something I've wanted for some time -- > I'd like 9P server bindings for lots of script languages, but tcl > always seemed to be a good fit for file-system control interfaces (and > I already have a bunch of stuff written in it too). I'm currently focussing on client, just proof-of-concept. I have not given much though what a nice tcl 9p server API might be; maybe there are some ideas? regarding client: turns out that the vfs support in tcl (as already present in tcl 8.4) is not sufficient to have a 9p client interface (it allows transparent navigating in the file system, but does not offer interception of operations on open(ed) file descriptors ('channels' in tcl-speak), to redirect read and write calls to own code)) however, the 'chan create' (sub)command of tcl 8.5(alfa) allows defining your own 'channel' where your own read/write/etc functions are called as a consequence of 'ordinary' operations on your 'channel' object (open file descriptor). experimentation suggests that the combination of the two features (all accesible from tcl, no C) is powerful enough to just mount your fs over 9p and then access it transparently via ordinary tcl (file) operations (so far only tried reading on readonly fs, no auth) this is a preliminary result - just a subset of functionality tried, my tcl code is far from a clean package, but I thought the intermediate result promising enough to warrant some noise - I, at least, was until very recently not aware of these possibilities in tcl. Axel.