Xref: utzoo comp.windows.ms.programmer:2291 comp.os.msdos.programmer:5046 Newsgroups: comp.windows.ms.programmer,comp.os.msdos.programmer Path: utzoo!sq!dak From: dak@sq.sq.com (David A Keldsen) Subject: Re: What to do about stdin, stdout, and stderr under Windows 3.0? Message-ID: <1991May7.213347.709@sq.sq.com> Keywords: Missing in action Organization: SoftQuad Inc. References: <1991Apr30.162028.7771@sq.sq.com> <6690@bwdls58.bnr.ca> Date: Tue, 7 May 91 21:33:47 GMT Lines: 45 >In article <1991Apr30.162028.7771@sq.sq.com> I wrote: >There is a device called NUL for use in the PC world. NUL == /dev/null Nice idea, but apparently "NUL" is magical to command.com. fopen() in the MSC libraries certainly doesn't do anything useful with "NUL" or "NUL:" I guess it's time for the summary, so here are the replies that I received in the mail: (1) /dev/null doesn't work, but /dev/nul *does*. (Ick! It works empirically, but I don't know if I trust MS not to change it, as it sounds like a bug.) (2) You shouldn't be using streams under Windows anyhow, read Petzold's book on Windows programming and redirect the output to a window. (Not applicable at this stage in development, although it's useful information; clearly this is the model intended for MS-WINDOWS, but for this particular purpose, tossing the output to /dev/null is just as useful.) (3) Try NUL (Doesn't work.) So, what I'm going to do is...none of the above. We're using a higher-level "port" abstraction for what we're doing, and we've created a "null port" which takes care of the problem and doesn't even use stdio. Someday, it'll do the appropriate magic for windowing systems... Thanks (in no particular order) to: cs352a41@zaphod.cs.iastate.edu. (Adam Goldberg) rogerhef@matt.ksu.ksu.edu (Roger Heflin) poffen@sj.ate.slb.com (Russ Poffenberger) Regards, Dak -- David A. 'Dak' Keldsen of SoftQuad, Inc. email: dak@sq.com phone: 416-963-8337 "It is well known that _things_ from undesirable universes are always seeking entrance into this one, which is the psychic equivalent of handy for the buses and closer to the shops." -- Terry Pratchett, _The Light Fantastic_