Connecting Tech Pros Worldwide Help | Site Map

(part 32) Han from China answers your C questions

  #1  
Old November 20th, 2008, 01:05 AM
George Orwell
Guest
 
Posts: n/a
File Seeking / Overwriting bytes

Martien Verbruggen said:
Quote:
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
https://www.mixmaster.it

  #2  
Old November 20th, 2008, 02:45 AM
Richard Heathfield
Guest
 
Posts: n/a

re: (part 32) Han from China answers your C questions


George Orwell said:
Quote:
File Seeking / Overwriting bytes
>
Martien Verbruggen said:
Quote:
>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.
Quote:
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
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
(part 20) Han from China answers your C questions Nomen Nescio answers 0 November 14th, 2008 04:45 PM
(part 10) Han from China answers your C questions Borked Pseudo Mailed answers 3 November 5th, 2008 07:05 PM