Message-ID: <35024b6e.flying-brick@flying-brick.caverock.net.nz> Date: Sun, 08 Mar 1998 19:40:28 +1200 From: "Eric Gillespie (Root)" Organization: The Flying Brick computer To: djgpp AT delorie DOT com, eliz AT is DOT elta DOT co DOT il Subject: Re: Pipes and how to seek Precedence: bulk In article you write: > > >On Mon, 30 Mar 1998, Eric Gillespie wrote: > >> Yeah, I agree, but only in part - I do ACTUALLY want to print the garbage >> heading through stdin, but it turns out the way I've been doing it, the >> stdin can't be set to O_BINARY anyway 8-(, at least not in this situation: >> >> cat strayfile.binary | hexdump Eli: >Why do you need `cat's *stdin* in binary? Isn't binary stdout enough? >If you have an example of a case where you need the >console to use binary I/O in a filter-style program like `cat' and >`hexdump', please describe that case. Sorry if what I said wasn't clear enough - yes, the *output* from cat needed to be set to binary, which you have stated it does anyway. Then how come the underlying OS (in this case, OpenDOS) truncates the file at the first ^ Z? >The portable way is to use `read' for reading the console (after >switching it to binary mode), and use `select' to check whether a key >has been hit. I'll try that and see what happens - but I've a funny feeling the problem's not caused by how I open stdin...it'll be one of the things I do when I try to make hexdump more ANSI compliant - but I suspect I'm going to hit a brick wall when I want to tell the ANSI boys that I want to print to a specific position of the screen - they'll say "What? a screen? What section of the Standard is that in please?" and they'd be right too. After the file gatherer bit is put on, I may alter hexdump to use pdcurses and/or GRX (I can't use Allegro - nobody has told me if it can use Herc 720x350 mode, and I also don't have the room on the HD) - then someone else can modify for use under (say) Xwindows if the need is there. Well, enough from me...