By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,942 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,942 IT Pros & Developers. It's quick & easy.

(part 32) Han from China answers your C questions

P: n/a
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
https://www.mixmaster.it

Nov 20 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Nov 20 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.