Path: utzoo!mnetor!uunet!husc6!think!ames!pacbell!att-ih!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: comp.lang.c Subject: why no fdopen() in dpANSI C? (was Re: Binary I/O on stdin/stdout?) Message-ID: <2567@ttrdc.UUCP> Date: 11 Apr 88 00:37:38 GMT References: <302@goofy.megatest.UUCP> <225800017@uxe.cso.uiuc.edu> <8042@elsie.UUCP> Organization: AT&T, Skokie, IL Lines: 19 Summary: why no fdopen() in dpANSI C? In article <8042@elsie.UUCP>, ado@elsie.UUCP (Arthur David Olson) writes: # > 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). Oh, GROAN. Why not? Sometims that's the most efficient way of getting a stdio stream open onto a file which needs options on open() or creat() other than the default, e.g. with permissions other than 0666&umask, or with a special open parameter like System V's O_SYNC. -- |------------Dan Levy------------| Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, | an Engihacker @ | }!ttrdc!ttrda!levy | AT&T Data Systems Group | Disclaimer? Huh? What disclaimer??? |--------Skokie, Illinois--------|