This is the mail archive of the
mailing list for the eCos project.
ftell() after fopen(..., "a") returning bogus position
- From: Stanislav Meduna <stano at meduna dot org>
- To: eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Fri, 18 Feb 2011 18:25:19 +0100
- Subject: [ECOS] ftell() after fopen(..., "a") returning bogus position
after a pretty standard
f = fopen("something", "a");
setvbuf(f, foo, _IOFBF, sizeof(foo));
n = ftell(f);
the file contains what I expect it to contain, but n containns
a bogus number - right now the file is 18587 bytes long
and ftell is returning 513.
Actually it might well be that it gets confused by the append
mode and is returning the number of characters written
since the fopen.
Does it look familiar to anyone? I'll be away from computer
for the next week, so I can first debug and produce a minimal
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss