Path: utzoo!mnetor!uunet!lll-winken!lll-tis!mordor!sri-spam!sri-unix!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: Binary I/O on stdin/stdout? Message-ID: <865@cresswell.quintus.UUCP> Date: 12 Apr 88 01:46:22 GMT References: <302@goofy.megatest.UUCP> <225800017@uxe.cso.uiuc.edu> <8042@elsie.UUCP> Organization: Quintus Computer Systems, Mountain View, CA Lines: 15 In article <8042@elsie.UUCP>, ado@elsie.UUCP (Arthur David Olson) writes: [ Citation omitted by Olson] > > If UNIX needed this facility, and if it used "b" to indicate binary mode, > > FILE *binin = fdopen(fileno(stdin), "rb"); > > FILE *binout= fdopen(fileno(stdout),"wb"); > > /* use bin_in, bin_out instead of stdin, stdout */ > > would do the job. Would this work in MSDOS? > > Whether or not it works in MSDOS, it wouldn't work in draft proposed ANSI C > (which lacks an "fdopen" function). That's hardly news: the point of the discussion was precisely that the ability to do binary I/O on stdin/stdout was something that some people needed and didn't appear to be available in dpANS. The point of my message was to suggest that instead of switching a stdio stream between several modes it might suffice to be able to attach new streams to existing ports.