I am currently trying to create a file that is exactly 1 Kb in size. So I created a file and opened it in binary mode.Next I fill the file with data in a for loop that runs 1024 times. Then I close the file. But when I check the file properties to seehow large the file is, Windows shows that there is 1,047 bytes in it. I've even tried running the loop 1001 times, and the size of the file after that is 1,048 bytes.
What is going on?
this is a sample of my code.
oh yeah, and the incorrect file size is the actual file size and not the size on disk size
1001100 1110101 1101011 1100101
What is going on?
this is a sample of my code.
Code:
dim buffer
dim bytecounter
buffer = spaces(1)
'put one byte of data in buffer
For byteCounter = 0 To 1024
Put #filenumber, , buffer
Next
1001100 1110101 1101011 1100101