Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

File I/O - change in file size

0 views
Skip to first unread message

Rayne

unread,
Dec 28, 2009, 4:05:59 AM12/28/09
to
Hi,

I'm not sure if this is the right place to ask, but I noticed
something strange with the files written by my program. I'm using
Windows Vista, and have written a program using Visual Studio .NET
2003. The program uses both fwrite( ) and WriteFile( ) to write
different binary files to disk. I was checking the contents of the
files using Hex Editor v2.0 by HHD Software after the program has
terminated. After the file was opened, I noticed that the size of the
file doubled in size, and returned to its original size once I close
the file. This does not happen if I use Notepad to open the file. The
contents remain unchanged.

I'm not sure if this is common with Windows systems, as I've never
seen this happen before. What is happening here?

Thank you.

Regards,
Rayne

Friedel Jantzen

unread,
Dec 28, 2009, 4:39:06 AM12/28/09
to
Hi,

> ...I was checking the contents of the


> files using Hex Editor v2.0 by HHD Software after the program has
> terminated. After the file was opened, I noticed that the size of the
> file doubled in size, and returned to its original size once I close
> the file. This does not happen if I use Notepad to open the file. The
> contents remain unchanged.

This could be a "feature" of the HHD Hex Editor (additional space for
editing?).
Which filesize is returned by Explorer's property dialog?
What do you get from GetFileSize, when you open the file with CreateFile?

Regards,
Friedel

Rayne

unread,
Dec 28, 2009, 8:34:33 PM12/28/09
to

This seems to be only specific to the Hex Editor. The file size
displayed in the property dialog is always doubled when opened by the
Hex Editor, be it a binary file, a MS Word file, or a pcap file. But
the file size returns to its original when it's opened by other
programs or when it's closed.

0 new messages