Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #16883

Re: stream functions

From John Gordon <gordon@panix.com>
Newsgroups comp.lang.c
Subject Re: stream functions
Date 2012-02-07 23:07 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <jgsar8$g8o$1@reader1.panix.com> (permalink)
References <4f319cb1$0$1049$bbae4d71@news.suddenlink.net>

Show all headers | View raw


In <4f319cb1$0$1049$bbae4d71@news.suddenlink.net> "Bill Cunningham" <nospam@nspam.invalid> writes:

>     Now I want to make sure I get this straight. fread and fwrite is for 
> binary files and data. fgets, fgetc, ftell, fseek, and the f*pos functions 
> are for textual data.

No, that's not right.

fread and fwrite work on both binary and text data.

fgets is for reading one line of text from a stream.

fgetc is for reading one character from a stream.

ftell and fseek are for getting and setting the position within a stream.

The f*pos() functions handle streams which are too large for ftell/fseek,
and they also have special code to handle multibyte stream content.

Where do you come up with this stuff, Bill?  Do you not have access to
documentation?

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

stream functions "Bill Cunningham" <nospam@nspam.invalid> - 2012-02-07 16:50 -0500
  Re: stream functions John Gordon <gordon@panix.com> - 2012-02-07 23:07 +0000
    Re: stream functions "Bill Cunningham" <nospam@nspam.invalid> - 2012-02-07 18:31 -0500
      Re: stream functions "Bill Cunningham" <nospam@nspam.invalid> - 2012-02-07 18:33 -0500
        Re: stream functions Johann Klammer <klammerj@NOSPAM.a1.net> - 2012-02-08 02:39 +0100
          Re: stream functions Keith Thompson <kst-u@mib.org> - 2012-02-07 18:39 -0800
            Re: stream functions "Bill Cunningham" <nospam@nspam.invalid> - 2012-02-07 22:36 -0500
              Re: stream functions Nobody <nobody@nowhere.com> - 2012-02-08 19:43 +0000
          Re: stream functions Barry Schwarz <schwarzb@dqel.com> - 2012-02-07 21:01 -0800
      Re: stream functions John Gordon <gordon@panix.com> - 2012-02-08 15:13 +0000
        Re: stream functions "Bill Cunningham" <nospam@nspam.invalid> - 2012-02-08 15:54 -0500
          Re: stream functions John Gordon <gordon@panix.com> - 2012-02-08 21:09 +0000
            Re: stream functions "Bill Cunningham" <nospam@nspam.invalid> - 2012-02-08 17:37 -0500
              Re: stream functions John Gordon <gordon@panix.com> - 2012-02-08 23:16 +0000
                Re: stream functions Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-13 02:14 -0800
                Re: stream functions James Kuyper <jameskuyper@verizon.net> - 2012-02-13 05:53 -0500
                Re: stream functions Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-13 03:23 -0800
                Re: stream functions Markus Wichmann <nullplan@gmx.net> - 2012-02-14 21:50 +0100
              Re: stream functions "Heinrich Wolf" <invalid@invalid.invalid> - 2012-02-09 10:45 +0100
                Re: stream functions "Bill Cunningham" <nospam@nspam.invalid> - 2012-02-09 22:37 -0500
          Re: stream functions Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-13 02:17 -0800
      Re: stream functions gordonb.qxgs4@burditt.org (Gordon Burditt) - 2012-02-13 01:03 -0600
        Re: stream functions Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-02-13 08:23 +0000
        Re: stream functions Keith Thompson <kst-u@mib.org> - 2012-02-13 02:06 -0800
        Re: stream functions David Thompson <dave.thompson2@verizon.net> - 2012-02-18 23:12 -0500

csiph-web