Date: Sun, 22 Mar 1998 16:24:36 +0300 (IDT) From: Eli Zaretskii To: DJ Delorie cc: djgpp-workers AT delorie DOT com Subject: Re: ^Z in text-mode output to the screen In-Reply-To: <199803151812.NAA18163@delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Sun, 15 Mar 1998, DJ Delorie wrote: > > C:\DJGPP\BIN> grep foobar * > > grep: writing output: No space left on device (ENOSPC) > > > > This happens if one of the files has the ^Z character embedded in it. > > Can we put stdout in raw mode without putting stdin in raw mode? It seems we can't. The small test program below says that when stdout is put into raw mode, stdin is reported to be in raw mode as well. That's what I would expect, since both these handles refer to the same device. But even if we could do that, how would this help solving the problem at hand? -------------------------------------------------------------------- #include #include #include #include #include int main (void) { __dpmi_regs r; setmode (fileno (stdout), O_BINARY); r.x.ax = 0x4400; /* IOCTL Get Device Info */ r.x.bx = fileno (stdin); __dpmi_int (0x21, &r); if (r.x.flags & 1) { printf ("214400\t Failed...\n"); return r.x.ax; } else { printf ("214400\t Succeeded; STDIN is in %s mode\n", (r.x.dx & 0x0020) ? "RAW" : "COOKED"); return 0; } }