Mail Archives: djgpp/1998/04/08/06:01:07
In article <Pine DOT SUN DOT 3 DOT 91 DOT 980330141110 DOT 19525K-100000 AT is> 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 <grumble> how come the underlying OS (in this case, OpenDOS) truncates
the file at the first ^ Z? </grumble>
>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.
<blather>
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.
</blather>
Well, enough from me...
- Raw text -