a couple of random questions

Doug Gwyn gwyn at brl-smoke.ARPA
Mon Apr 25 02:07:53 AEST 1988


In article <2636 at bsu-cs.UUCP> dhesi at bsu-cs.UUCP (Rahul Dhesi) writes:
>(a) keep reading until you hit end-of-file
>(b) do an ftell
>(c) do an fseek to end-of-file (with whence=2, offset=0L)
>(d) do an ftell again
>The two ftells will give different answers.

Although I believe this to be correct, I don't see what relevance it has
for the preceding discussion.  Certainly we never promised that the
cookies returned by ftell() were uniquely determined by the byte-stream
model position.  In fact, in a record-oriented architecture, it is easy
to imagine that an ftell() cookie might represent the same position as
either the record number plus an offset into it, or as the next record
number minus an offset back into the preceding record, depending on how
one has been manipulating the stream.



More information about the Comp.lang.c mailing list