file i/o troubles
Andrew Bythell
abythell at nortelnetworks.com
Fri Apr 20 16:05:49 UTC 2001
Hi -
Attached is a sample application that demonstrates the problem.
Andrew.
jennifer averett wrote:
>
> Do you have a complete test that shows this problem that you
> could submit? It is much easer to reproduce and
> fix problems that way.
>
> Thanks
> Jennifer
>
> Andrew Bythell wrote:
>
> > Hello -
> >
> > I am seeing strange behaviour when writing to files using the IMFS and
> > rtems-ss-20010326. I had this same problem with earlier snapshots too.
> > Consider:
> >
> > FILE *fp = fopen("somefile", "w");
> > fprintf(fp, "line1\n");
> > fclose();
> > fp = fopen("somefile", "a");
> > fprintf("fp, "line2\n");
> > fclose();
> >
> > The first time I call this routine, 'somefile' is created and contains:
> >
> > line1
> > line2
> >
> > which is fine. Subsequent calls, using the same or different filename,
> > insert junk (NULL characters) between line1 and line2:
> >
> > line1
> > ^@^@^@^@^@^@...
> > line2
> >
> > Can anyone offer an explanation and/or solution?
> >
> > --
> > Andrew Bythell
> > Nortel Networks System Verification
> > Ottawa, Ontario Canada esn.39.56930
> > tel.613.765-6930 fax.613.763-7795
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ftest.tar.gz
Type: application/x-gzip
Size: 2321 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20010420/648df796/attachment-0001.bin>
More information about the users
mailing list