Article View: comp.sys.amiga.tech
Article #14000Re: forcing a flush w/ AmigaDos I/O
From: Steve Koren
Date: Fri, 02 Mar 1990 14:50
Date: Fri, 02 Mar 1990 14:50
37 lines
2258 bytes
2258 bytes
One more for the AmigaDos I/O gurus:
How can I tell whether I have reached eof without actually reading
anything from the file? That is, I am aware that if Read() returns
<= 0 when you asked for a positive number of byte, you either hit the
end of the file or had an error. But what if (for a reason that is
not important here - you'll have to trust me that it's necessary) I
have a file pointer but don't want to call Read() to check eof status?
I can't seem to find an Feof() call for AmigaDos I/O.
thanks for any help....
- steve
PS - the motivation for my recent AmigaDos I/O questions is this: I
was very unsatisfied with both the size and performance of the
SKsh external commands. I have already changed them to AmigaDos
I/O (from Lattice), and they are now much smaller and from 5
to 10 times faster. That part was easy, since the external
commands (even the new 1.4 ones such as grep) are quite simple.
However, I am planning to implement *real* pipes in SKsh 1.4
using the 'cmd | cmd' syntax and the AmigaDos pipe device. To
do this, I need to convert at least some of SKsh to AmigaDos
I/O (from ansi). I've found a few capabilities that I need but
can't find, such as this and the Fflush() call. Any help would
be greatly appriciated!
PPS- I am still hoping to finish SKsh 1.4 by late march or early
april, although it depends on 1) how much time I can devote to
it, and 2) how long I get stuck on stuff like this.
PPPS - So far, empirical results seem to suggest that the AmigaDos
Read() call is from 5 to 10 times faster than the Lattice read()
call. A file which used to take 17 seconds to 'wc -c' now
takes 2 seconds with the SKsh 1.4 wc command. I wonder how the
Lattice call is implemented?
Technical Details
Message-ID:
<13920053@hpfelg.HP.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hpfelg!korenReferences:
<13920051@hpfelg.HP.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hpfelg!koren From: koren@hpfelg.HP.COM (Steve Koren) Newsgroups: comp.sys.amiga.tech Subject: Re: forcing a flush w/ AmigaDos I/O Message-ID: <13920053@hpfelg.HP.COM> Date: 2 Mar 90 14:50:49 GMT References: <13920051@hpfelg.HP.COM> Organization: HP Elec. Design Div. -FtCollins Lines: 37