www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/01/15:35:38

Message-ID: <3522a20e.flying-brick@flying-brick.caverock.net.nz>
From: Eric Gillespie <viking AT flying-brick DOT caverock DOT co DOT nz>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, eldredge AT ap DOT net, djgpp AT delorie DOT com
Date: Thu, 2 Apr 1998 08:22:37 NZT-12DST
Subject: Re: Pipes and how to seek

Captains Log, Stardate  1 Apr 98 17:00, Admiral Eli Zaretskii:
:The natives are rebelling - saying WE WANT CP/M BACK!
Just kidding - Late April Fools joke!!
What you really said, was:
: > if (isatty(fileno(stdin))
: >    setmode(fileno(stdin), O_BINARY);
: 
: Should be "!isatty", right?

Oooops - I missed that one!  Mind you, I had it right in my program:: 
#ifdef STDINVER
    if(fi->FName==0)  { /* If nothing else specified on command line.. */
          fi->FPtr=stdin;   /* We'll just have to scrap this, I think... *x/
          fi->FName="STDIN";
          fflush(stdin); /* Just to satisfy the purists... */
          setmode(fileno(stdin), O_BINARY);
/* Else if I don't have the above code selected, the below lines apply */
#else
        printf("hexdump: No filename specified on commandline\n");
        exit(EXIT_FAILURE); /* Ooops - nearly left this enabled ... */
#end

: > while `kbhit' and `getch' talk directly to the BIOS.
: 
: That's a common misconception.  `getch' calls DOS character input 
: function, so it can be redirected (try it).  (`kbhit' indeed calls BIOS, 
: so it cannot be used with redirected stdin.)
So that's why I did the following (I might have mentioned this already):

            while(!(kbhit())) ; /* wait for key ... */
            getxkey(); /* swallows key ... */

Well, the news is now, that I have strange problems with my program (and it 
doesn't have anything to do with the STDIN) overwriting bits of itself 
again... 8-(

Still, I'll let you know what luck I had in sorting it out - I had it once 
before, so now I have to figure out what I've done wrong...

Well, cheers for now...
The Viking 




---
 /|   _,.:*^*:.,   |\  Cheers from the Viking family ... 
| |_/'  viking@ `\_| | including Marmalade - Running OpenDOS in Christchurch!
|    flying-brick    | $FunnyMail 5.38 C.S. Lewis:  If Man has no God,
 \_.caverock.net.nz_/  then where did Man's morals come from?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019