one byte == one character... right?
A stupid question here. I've been in the analyzing mode all day... don't know why.
Anyway...
I've always been taught/told that one character is equal to one byte.
Quote:
Bits in strings of eight are called bytes, and one byte usually represents a single character of data in the computer. It's a little used term, but you might be interested in knowing that a nibble is half a byte (usually 4 bits).
source
Ok, I understand that.
What I don't get.
Say I create a new text document using notepad. I name the file test.txt and save it with no contents. Since the filename has 8 characters, shouldn't it already have a file size of 8 bytes?
This is not the case... if the document has no contents then it is 0 bytes. I'm assuming because the document contains no data within the file. But, wouldn't it still require 8 bytes *somewhere* to store the filename? Not to mention *where* to find the file... on the hard drive. (pointer to the sector(s) )
Why is the space used for filenames excluded?
Sorry, I know... it's stupid. I've just been over analyzing almost everything I see today.
I first noticed it when I tried to tftp a document named test.txt to my router only to tell me that it was 0 bytes and it couldn't be copied. Then I opened the doc and typed the word "test" and it transfered over 4 bytes. Not 12 bytes. (the 4 within the doc and the 8 I used for the filename)