Stream I/O

This is a discussion on Stream I/O within the C Programming forums, part of the General Programming Boards category; I am having trouble finding good websites to reference on Stream I/O so I can do some research on it. ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    96

    Stream I/O

    I am having trouble finding good websites to reference on Stream I/O so I can do some research on it. Any good references?

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    This one looks good. It is very concise/precise.

    Read the stuff on "low level" i/o, too. I think people learning C actually get sold the idea that there is something better or easier about using "streams" (when really there is not) because otherwise they would not be motivated to understand them, which they do provide a conceptual contrast or development. But the low level functions are actually simpler and work better. The higher level ones (streaming) use the low level ones in the background anyway.
    Last edited by MK27; 02-21-2009 at 06:15 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    96
    Oh I definitely understand what your saying MK, I should have specified that I also am making a webpage specific to stream I/O and that is why I would like to gather as much information as I can on the subject. Thank you though

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    96
    Any suggestions?

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Hi! What I meant was that since stream I/O functions are built on top of low level functions, a great way to present them would be (for example) to use some source code for fopen(), etc. (you could distill this from which ever "real world" source you want) which uses the lower level functions, and thus demonstrate how stream I/O works, and what the commands do when you use them.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,648
    Quote Originally Posted by MK27
    I think people learning C actually get sold the idea that there is something better or easier about using "streams" (when really there is not)
    I'd say that one advantage of streams over low level functions is that they are standard.

    Quote Originally Posted by MK27
    But the low level functions are actually simpler and work better.
    They are not necessarily simpler, e.g., many functions in the Windows API do not really follow the "do one thing and do it well" principle that is more common place in *nix interfaces.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by laserlight View Post
    I'd say that one advantage of streams over low level functions is that they are standard.

    They are not necessarily simpler, e.g., many functions in the Windows API do not really follow the "do one thing and do it well" principle that is more common place in *nix interfaces.
    So fopen() would be considered more portable than open(), and fscanf() more than read()?
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,648
    Quote Originally Posted by MK27
    So fopen() would be considered more portable than open(), and fscanf() more than read()?
    Definitely, though I think that fread() is a closer equivalent to read().
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Raw I/O vs. Stream I/O
    By NuNn in forum C Programming
    Replies: 1
    Last Post: 03-17-2009, 08:32 AM
  2. I/O stream files
    By malooch in forum C Programming
    Replies: 4
    Last Post: 12-12-2006, 08:58 AM
  3. Overlapped I/O and Completion Port :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 10-30-2002, 04:14 PM
  4. i/o stream
    By lupi in forum C++ Programming
    Replies: 1
    Last Post: 09-09-2001, 12:55 AM
  5. Looping and I/O Stream
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 09-07-2001, 10:20 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21