Why adding only characters to a text file may increase the file's size by several hundred bytes and at other times may not increase the file's size at all?

1 answer

You are probably looking at the directory listing. Some list them as the real size, some list them as what has been assigned. Operating systems do not assign one byte at a time when the file needs to expand. Space is assigned in blocks, of which a common size is 512 bytes.

So as long as the content of the file does not exceed the last assigned block, the file size does not increase. Once it is exceeded, the operating system will assign an extra block of 512 bytes, thus your observation.
Similar Questions
    1. answers icon 1 answer
    1. answers icon 1 answer
  1. Why might you need to convert a file to another file type?A. It is a music or image file. B. The file is old. C. The file uses a
    1. answers icon 9 answers
  2. What does a file extension tell you?A. what the file is about******* B. where the file is located C. what type of file it is D.
    1. answers icon 11 answers
more similar questions