need tutorial on low level file i/p o/p

Discussion in 'C Programming' started by broli, Mar 13, 2008.

  1. broli

    broli Guest

    i looked up a few on the internet but it seems there is way too much
    contradictions. It doesn't seem like K & R 2 covers it either.
    broli, Mar 13, 2008
    #1
    1. Advertising

  2. broli

    Ian Collins Guest

    broli wrote:
    > i looked up a few on the internet but it seems there is way too much
    > contradictions. It doesn't seem like K & R 2 covers it either.


    Covers what? Ah, file IO. Please put your question in the body of your
    post.

    What don't you understand? fread and fwrite are pretty straightforward
    functions.

    --
    Ian Collins.
    Ian Collins, Mar 13, 2008
    #2
    1. Advertising

  3. broli

    broli Guest

    On Mar 13, 2:16 pm, Ian Collins <> wrote:
    > broli wrote:
    > > i looked up a few on the internet but it seems there is way too much
    > > contradictions. It doesn't seem like K & R 2 covers it either.

    >
    > Covers what? Ah, file IO. Please put your question in the body of your
    > post.
    >
    > What don't you understand? fread and fwrite are pretty straightforward
    > functions.
    >
    > --
    > Ian Collins.



    I think open and read are the commands used for low level file
    operations.
    broli, Mar 13, 2008
    #3
  4. broli

    Ian Collins Guest

    broli wrote:
    > On Mar 13, 2:16 pm, Ian Collins <> wrote:
    >> broli wrote:
    >>> i looked up a few on the internet but it seems there is way too much
    >>> contradictions. It doesn't seem like K & R 2 covers it either.

    >> Covers what? Ah, file IO. Please put your question in the body of your
    >> post.
    >>
    >> What don't you understand? fread and fwrite are pretty straightforward
    >> functions.
    >>

    Please don't quote signatures.
    >
    > I think open and read are the commands used for low level file
    > operations.


    You are confusing POSIX I/O functions with those from standard C. C
    offers the 'f' family of functions which operate on FILE* streams.
    POSIX functions use file descriptors.

    For more information on those, consult you man pages then ask on
    comp.unix.programmer.

    --
    Ian Collins.
    Ian Collins, Mar 13, 2008
    #4
  5. broli

    santosh Guest

    broli wrote:

    > On Mar 13, 2:16 pm, Ian Collins <> wrote:
    >> broli wrote:
    >> > i looked up a few on the internet but it seems there is way too
    >> > much contradictions. It doesn't seem like K & R 2 covers it either.

    >>
    >> Covers what? Ah, file IO. Please put your question in the body of
    >> your post.
    >>
    >> What don't you understand? fread and fwrite are pretty
    >> straightforward functions.


    > I think open and read are the commands used for low level file
    > operations.


    Open and read are actually POSIX defined functions. The standard itself
    is available at:

    <http://www.unix.org/version3/online.html> You need to "register".
    <http://www.opengroup.org/onlinepubs/009695399/> Free to read.

    Some tutorials that incorporate these low level I/O functions are:

    <http://www.cs.cf.ac.uk/Dave/C/>
    <http://www.faqs.org/docs/artu/>
    <http://www.iu.hio.no/~mark/unix/unix_toc.html>
    santosh, Mar 13, 2008
    #5
  6. In article <>,
    Ian Collins <> wrote:
    >broli wrote:
    >> On Mar 13, 2:16 pm, Ian Collins <> wrote:
    >>> broli wrote:
    >>>> i looked up a few on the internet but it seems there is way too much
    >>>> contradictions. It doesn't seem like K & R 2 covers it either.
    >>> Covers what? Ah, file IO. Please put your question in the body of your
    >>> post.
    >>>
    >>> What don't you understand? fread and fwrite are pretty straightforward
    >>> functions.
    >>>

    >Please don't quote signatures.
    >>
    >> I think open and read are the commands used for low level file
    >> operations.

    >
    >You are confusing POSIX I/O functions with those from standard C. C
    >offers the 'f' family of functions which operate on FILE* streams.
    >POSIX functions use file descriptors.


    I don't think "confused" is the word.

    Asking about something which is:

    Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

    Yes. True.
    Kenny McCormack, Mar 13, 2008
    #6
  7. broli

    CBFalconer Guest

    broli wrote:
    > Ian Collins <> wrote:
    >> broli wrote:
    >>
    >>> i looked up a few on the internet but it seems there is way too
    >>> much contradictions. It doesn't seem like K & R 2 covers it
    >>> either.

    >>
    >> Covers what? Ah, file IO. Please put your question in the body
    >> of your post.
    >>
    >> What don't you understand? fread and fwrite are pretty
    >> straightforward functions.

    >
    > I think open and read are the commands used for low level file
    > operations.


    No they are not. They are not in the standard C library. Some
    systems may have them at a different level. Others may not.

    --
    [mail]: Chuck F (cbfalconer at maineline dot net)
    [page]: <http://cbfalconer.home.att.net>
    Try the download section.



    --
    Posted via a free Usenet account from http://www.teranews.com
    CBFalconer, Mar 13, 2008
    #7
  8. broli

    Richard Guest

    Ian Collins <> writes:

    > broli wrote:
    >> i looked up a few on the internet but it seems there is way too much
    >> contradictions. It doesn't seem like K & R 2 covers it either.

    >
    > Covers what? Ah, file IO. Please put your question in the body of your
    > post.
    >
    > What don't you understand? fread and fwrite are pretty straightforward
    > functions.


    What don't you understand about low level file access? Are you trying
    for Mr Pedantic CLC 2008 this year?

    To the op, here is some related stuff:

    http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_12.html

    A good start for finding your platform specifics I dare say.

    Good luck!
    Richard, Mar 13, 2008
    #8
  9. broli

    santosh Guest

    broli wrote:

    > i looked up a few on the internet but it seems there is way too much
    > contradictions. It doesn't seem like K & R 2 covers it either.


    K&R2 do cover some of these functions in chapter eight. Also see the
    links I gave you elsethread.
    santosh, Mar 13, 2008
    #9
  10. broli

    osmium Guest

    "broli" writes:

    >i looked up a few on the internet but it seems there is way too much
    > contradictions. It doesn't seem like K & R 2 covers it either.


    One possible hotbed of contradictions is to compare this newsgroup
    commentary with K&R. K&R covers *all* the functions and does not give any
    editorial content on which ones to use, which should be favored and so on.
    After several years of experience with careless (or whatever) coding, some
    of the functions are considered by the mavens as dangerous and unfit to
    use. A little time spent following some of the threads on this subject on
    this newsgroup exposes the pitfalls involved with some of the verboten
    functions. Think of a monkey typing aimlessly for hours in response to a
    simple, single request for "Age ?" to see a lot of these problems. Pretend
    that after 50 years or so a human intervenes and presses the Enter key.
    osmium, Mar 13, 2008
    #10
  11. broli

    John Bode Guest

    On Mar 13, 4:02 am, broli <> wrote:
    > i looked up a few on the internet but it seems there is way too much
    > contradictions. It doesn't seem like K & R 2 covers it either.


    Do you have a specific question in mind? File I/O covers a lot of
    ground.
    John Bode, Mar 13, 2008
    #11
  12. broli

    Default User Guest

    broli wrote:

    > i looked up a few on the internet but it seems there is way too much
    > contradictions. It doesn't seem like K & R 2 covers it either.



    Incorrect. Look at chapter 8 of K&R2, UNIX system interface,
    specifically:

    8.2 Low Level I/O - Read and Write





    Brian
    Default User, Mar 13, 2008
    #12
  13. broli

    CBFalconer Guest

    Default User wrote:
    > broli wrote:
    >
    >> i looked up a few on the internet but it seems there is way too
    >> much contradictions. It doesn't seem like K & R 2 covers it either.

    >
    > Incorrect. Look at chapter 8 of K&R2, UNIX system interface,
    > specifically:
    >
    > 8.2 Low Level I/O - Read and Write


    That is not part of the language. It is an indication of the
    implementation. The chapter is so marked.

    --
    [mail]: Chuck F (cbfalconer at maineline dot net)
    [page]: <http://cbfalconer.home.att.net>
    Try the download section.



    --
    Posted via a free Usenet account from http://www.teranews.com
    CBFalconer, Mar 13, 2008
    #13
  14. broli

    Default User Guest

    CBFalconer wrote:

    > Default User wrote:
    > > broli wrote:
    > >
    > >> i looked up a few on the internet but it seems there is way too
    > >> much contradictions. It doesn't seem like K & R 2 covers it either.

    > >
    > > Incorrect. Look at chapter 8 of K&R2, UNIX system interface,
    > > specifically:
    > >
    > > 8.2 Low Level I/O - Read and Write

    >
    > That is not part of the language. It is an indication of the
    > implementation. The chapter is so marked.


    So? The statement was, "It doesn't seem like K & R 2 covers it either."




    Brian
    Default User, Mar 13, 2008
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page