[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
file i/o troubles
- Date: Thu, 19 Apr 2001 13:49:06 -0400
- From: abythell at nortelnetworks.com (Andrew Bythell)
- Subject: file i/o troubles
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