Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: My problem with fdopen and sockets........ Message-ID: <15982@mimsy.UUCP> Date: 16 Feb 89 16:50:40 GMT References: <7937@netnews.upenn.edu> <9556@cit-vax.Caltech.Edu> Distribution: na Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 13 In article <9556@cit-vax.Caltech.Edu> wen-king@cit-vax.Caltech.Edu (King Su) writes: >in = fdopen(soc,"r"); >out = fdopen(soc,"w"); If you use this technique, be aware that fclose(in) also closes out's file descriptor, without giving it a chance to flush any pending data. Likewise, fclose(out) closes in's fd. There is also no guarantee that stdio will not get upset if fclose's implied close() fails. This might, for instance, lead to running out of FILE structures. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris