|
From: Kit Li <kwl...@ya...> - 2009-08-13 18:49:36
|
Hi,
I have a question about reading binary files(1.4gb in size) through fopen() and fread(). The binary files
I have originated from a Linux environment and I can't read them as
is. I thought something was wrong w/ my fread or the file size.
However, when I run the head command from Msys
to get all the lines out to a temp file or use cat, then I can read the
file fine. The head command might have added \r when its writing the
data out, but cat is a straight passthrough(not literally).
I then tried the unix2dos approach:
sed -e p "$@" | awk '{print $0"\r"}' binary_file.bin > new_binary_file.bin
But
that doesn't work. That gets me to believe there's more to head and
cat. Does anyone have any thoughts on that? In addition, what part of
the Msys source contains the code to head and cat? Any help is
appreciated.
|