This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ftell() after fopen(..., "a") returning bogus position


Hi,

after a pretty standard

  f = fopen("something", "a");
  setvbuf(f, foo, _IOFBF, sizeof(foo));
  fputs("something", f);
  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
example later.

Regards
-- 
                                 Stano

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]