(part 32) Han from China answers your C questions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • George Orwell

    #1

    (part 32) Han from China answers your C questions

    File Seeking / Overwriting bytes

    Martien Verbruggen said:
    I don't think SEEK_END, which I assume you'd use to position at the end,
    is supported on text streams.
    And this is, of course, also not right. fseek() does support
    SEEK_END on text streams.

    If you want to know why, please start a thread on comp.lang.c.
    Also, you could read "(part 18) Han from China answers your C questions".

    But if you post to comp.lang.c, beware of noise from people who don't
    really know the subject well enough, but feel they have to comment
    anyway.

    Yours,
    Han from China

    Il mittente di questo messaggio|The sender address of this
    non corrisponde ad un utente |message is not related to a real
    reale ma all'indirizzo fittizio|person but to a fake address of an
    di un sistema anonimizzatore |anonymous system
    Per maggiori informazioni |For more info
    Find information, resources and relevant links for mixmaster.it. This domain may be for sale.


  • Richard Heathfield

    #2
    Re: (part 32) Han from China answers your C questions

    George Orwell said:
    File Seeking / Overwriting bytes
    >
    Martien Verbruggen said:
    >I don't think SEEK_END, which I assume you'd use to position at the end,
    >is supported on text streams.
    >
    And this is, of course, also not right.
    True enough.
    fseek() does support SEEK_END on text streams.
    Only partly. You can use SEEK_END to get to the end of a text stream (so
    yes, you *can* position at the end), but you can't use it to get N bytes
    from the end for N != 0. See 4.9.9.2 of C89.

    --
    Richard Heathfield <http://www.cpax.org.uk >
    Email: -http://www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999

    Comment

    Working...