Mail Archives: djgpp/1992/09/18/18:41:24
Here is a fragment of a program:
if (*argv && !freopen(*argv++,"r",stdin))
perror(argv[-1]),
exit (1);
if (isatty(0))
fputs("\nCan't handle stdin as a tty!\n",stderr),
exit (1);
Seems pretty clear, and when I run this under GO32, I get the expected
result. I.e., if *argv == 0, you get "Can't handle...", if *argv is a
file that exists, all is fine, else you get a "file not found" msg from
the freopen() [Actually, of course, from the perror()].
But, when I run it under DEBUG32, and the file exists, I still get an
abort for "Can't handle..."
(This is with the latest DJGPP, GO32, etc)
- Raw text -