From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1c146fcd200ff99cceed6495391ae5be@quanstro.net> From: erik quanstrom Date: Fri, 24 Mar 2006 08:39:48 -0600 To: 9fans@cse.psu.edu Subject: Re: [9fans] rc question MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 1f28cf5a-ead1-11e9-9d60-3106f5b1d025 i think you're making this too complicated. you wouldn't want to use <> with a real file. a fileserver like ndb/dns often ignores seeks. why use a non-default file descriptor? why wouldn't this work? <> /net/dns { echo google.com ip >[1=0] ; cat} if you have a fileserver that does not ignore seeks, then this would work <> fspath { echo cmd ; syscall seek 0 0 0; cat} - erik rog@vitanuova.com writes | | geoff: | > <>[4]/net/dns { echo google.com ip >[1=4]; cat <[0=4] } | | if you're expecting the cat to start at offset 0, you'd be mistaken | (the dup only ups the refcount on the underlying Chan, | so the seek offsets are shared). | | cpu% echo one two three four five six > x | cpu% | cpu% <>[4] x {echo xxx >[1=4]; cat <[0=4]} | two three four five six | cpu% cat x | xxx | two three four five six | cpu% | | you can probably do it with dd. the "read" command in inferno | is a more direct analog of the system call, and allows a "-o" flag | to set the offset. i found it quite often useful to know that one | is getting one and only one (p)read.