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
[EMAIL PROTECTED] 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.