Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!hp4nl!eutrc3!euteal!gjalt From: gjalt@euteal (Gjalt de Jong) Newsgroups: comp.lang.c Subject: Re: File descriptors and streams and copying thereof. Message-ID: Date: 13 Apr 89 07:26:13 GMT References: <1743@leah.Albany.Edu> Sender: news@euteal.UUCP Organization: Eindhoven University of Technology, Eindhoven, The Netherlands. Lines: 20 In-reply-to: rds95@leah.Albany.Edu's message of 12 Apr 89 14:08:50 GMT I found this piece of code in original article: > stdin->fd = my_file->fd; > if (yyparse()) /* stuff*/ else /* stuff */ > stdin->fd = 0; /* presume stdin is/was fd 0 */ I do not hope there are many people out there using this tricky stuff to get the file descriptor of a stream. Because, not all machines have this file descriptor field in the file pointer structure! But there are better ways to get information about streams. You can use 'fileno', which is defined in , to get the file descriptor of a stream. -- Gjalt G. de Jong, | Phone: +(31)40-473345 Eindhoven University of Technology, Dept. of Electr. Eng. P.O. Box 513, 5600 MB Eindhoven, The Netherlands Email: gjalt@euteal UUCP: {...}!mcvax!hp4nl!euteal!gjalt