E
ericunfuk
Hi ALL,
I want to read a binary file(it's pic.tif file, I guess it's binary
file?), then write it to a new file), I have several questions about
this process:
When I use fread() to read a chunk of the file into a buffer, when it
encounters the end of the file, will the EOF indicator be put into the
buffer automatically just as an ordinary byte of the file, or do I
have to do it manually?
When I want to write chunks received to a new file, do I just write
each chunk sequentially until EOF? Do I need to append EOF to the new
file?
Suppose all chunks have been received and written to the new file,
then if I just name the new file with the correct extension, say
pic2.tif,will I be able to recover the original file like this?
I'm very new to C so your help is much appreciated.
Thanks in advance.
I want to read a binary file(it's pic.tif file, I guess it's binary
file?), then write it to a new file), I have several questions about
this process:
When I use fread() to read a chunk of the file into a buffer, when it
encounters the end of the file, will the EOF indicator be put into the
buffer automatically just as an ordinary byte of the file, or do I
have to do it manually?
When I want to write chunks received to a new file, do I just write
each chunk sequentially until EOF? Do I need to append EOF to the new
file?
Suppose all chunks have been received and written to the new file,
then if I just name the new file with the correct extension, say
pic2.tif,will I be able to recover the original file like this?
I'm very new to C so your help is much appreciated.
Thanks in advance.