🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9213

Re: fgets() returns NULL at EOF??

#9213
From: Clayton Cramer
Date: Fri, 29 Aug 1986 00:55
16 lines
1180 bytes
> O great C gurus, help a relative greenhorn!  Why is it that fgets()
> returns NULL when it reaches end of file, whereas all the other
> standard i/o functions seem to return EOF at that point?  This
> confuses me, especially since one would suppose fputs() to be the
> partner function of fgets() and therefore to work in the same way.
> 
> Sterling Bjorndahl
> BJORNDAS at CLARGRAD on BITNET

Ah, heck.  Next you'll complain because fgets() and gets() do different
things to the \n at the end of a string.

There are days I wish every line of C currently existing would evaporate,
so that the I/O functions could be...rationalized.

Clayton E. Cramer
Technical Details
Message-ID: <1040@kontron.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!lll-lcc!pyramid!voder!kontron!cramer
References: <3170@brl-smoke.ARPA>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!lll-lcc!pyramid!voder!kontron!cramer
From: cramer@kontron.UUCP (Clayton Cramer)
Newsgroups: net.lang.c
Subject: Re: fgets() returns NULL at EOF??
Message-ID: <1040@kontron.UUCP>
Date: Thu, 28-Aug-86 20:55:46 EDT
Article-I.D.: kontron.1040
Posted: Thu Aug 28 20:55:46 1986
Date-Received: Fri, 29-Aug-86 05:33:23 EDT
References: <3170@brl-smoke.ARPA>
Organization: Kontron Electronics, Mt. View, CA
Lines: 16