5

I created a simple text file. I saw its size. it was 0 bytes. Then i entered alphabet 'a' and checked the size of it. IT says:

Size : 1 bytes

Size on disk: 4.00 KB(4096 bytes)

What is the difference? And why two different values for the same data? OS I am referring to is Windows.

fixer1234
  • 28,064
Sandeep
  • 683

1 Answers1

10

The hard drive can be seen as a long string of bits and bytes. The way the hard drive can be used as a thing to hold folders and files is using a filesystem.

Most filesystems use blocks to hold files. Each file consists of one or more blocks. So a file takes at least the size of one block, in your case 4 kilobyte (which is a small block).

This is all highly dependent on which filesystem you use, but this is most likely the explanation.

orlp
  • 1,577