473,237 Members | 1,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 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 1183

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

Similar topics

by: aa | last post by:
I am trying to read a.php file from another PHP file using fgets() and display its contents. As a.php starts with <? the browser IE6 does not show anything, although I can see all the contents in...
by: jase_dukerider | last post by:
Hi I have an assignment to hand in shortly for which I am after some guidance. The task is to read a WAV file, request a fade in /out time for the track from the user and the do the fade by...
by: Joshua Ammann | last post by:
Hello, I'm trying to export a query containing contact information, including a field. Some zip codes have one or two leading zeros, for example, San Juan, PR (00927) and Springfield, MA...
by: comp_novice | last post by:
I need to control the number of digits to be printed after the exponential. Please have a look at the example below: float fVal = 0.06854344 The printf that I am using is fprintf(pfile,...
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
by: prasadjoshi124 | last post by:
Hi All, I am writing a small tool which is supposed to fill the filesystem to a specified percent. For, that I need to read how much the file system is full in percent, like the output given...
by: Ympostor | last post by:
Hello. Is there a method in the .NET class libraries to know if a given file is binary or just plain text (ASCII)? Thanks in advance. --
by: Jeff | last post by:
Im trying to figure out why I cant read back a binary file correctly. I have the following union: #define BITE_RECORD_LEN 12 typedef union { unsigned char byte; struct { unsigned char type;...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.