Imagine I am writing to a file directly to the position 1025 bytes, leaving the first 1024 bytes in null.
I want to open the file again, and searching from the first byte position, check if the first byte is null (hasn’t real data)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How would you expect to tell the difference between a file which had 1024 bytes all written out as zero, and a file which “hasn’t real data”?
If all you want to do is check for the first 1024 bytes being zero, just read the data and compare it in the normal way.