471,059 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,059 software developers and data experts.

File contains only or mainly zero

I've got a problem with an embedded PC which generates corrupted files during a shutdown-boot cycle. The corrupted files contain the correct (estimated) number of bytes, but all bytes have a zero value. To make the problem more interesting this occurs sometimes (after 1 cycle or after 30 cycles), and when it happens it can be possible that only the last number of bytes of the file contain zero's. Shutdown means that the power is shut down on the complete machine, thus stopping the PC immdiately. There's no way of forcing the OS to start a shutdown process.

System used:
Embedded PIV platform based on Intel 845GV chipset.
Harddisk: Maxtor Fireball 3 or Diamonmax Plus 8 (40Gb). Microsoft XP embedded, EWF using RAM overlay on c: partition. Corrupted files are created on NTFS non-EWF d: partition.

File handling code (c++):

m_hFile = CreateFile( fname,

if (m_hFile)
//doing stuff...


And on the same file(s), not at the same time:

fp = fopen(fname,"rt");

if (fp)
//doing stuff...


I suspect that some kind of buffer failed to write (all) bytes to an already prepared file. This explains the number of bytes being zero. If this is an OS buffer, a filesystem buffer or a hardware buffer is unclear to me. Does one of you have experienced the same problem, or got any idea on how I can solve this problem? "

Afsluiting :) :
Thanks in advance,

Greetings from your big friend from The Netherlands, "
Jul 21 '06 #1
0 1088

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by aa | last post: by
1 post views Thread by jase_dukerider | last post: by
3 posts views Thread by comp_novice | last post: by
7 posts views Thread by Ympostor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.