[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
file i/o troubles
- Date: Fri, 20 Apr 2001 12:05:49 -0400
- From: abythell at nortelnetworks.com (Andrew Bythell)
- Subject: file i/o troubles
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://rtems.rtems.org/pipermail/rtems-users/attachments/20010420/648df796/attachment.gz