English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

If I create a file called data.txt which has 0 bytes acording to windows, can you say that the actual size is 8 bytes since that is the length of the filename?

2007-03-13 08:59:05 · 3 answers · asked by Xeltran1 3 in Computers & Internet Programming & Design

3 answers

The short answer: No.

Older versions of Windows use FAT, while newer ones use NTFS for storage of files on hard disk. Both of these separate the file "metadata" from the actual file contents. The file metadata consists of things like the filename, creation date, permissions, time last modified, etc. Generally, all metadata is kept in one location, while the file data is spread over the disk. If you did wish to count the metadata however, the filesize would be much greater than 8 bytes. For example, even though there are only 8 characters in the filename, NTFS stores filenames as unicode, which means each character is actually 2 bytes, leaving a 16byte filename. There is also probably an additional 2 bytes to indicate the end of the "string".

2007-03-13 09:28:30 · answer #1 · answered by GoatCheez 2 · 0 0

NO! It takes 8 bits to notate each character.
8 bits = 1 byte.
If we took a metal bar and filed it, we would create a lot of bite of metal dust.

We use metal dust, each bit of it, arranged so that the metal bits are in a given order.
Computer data is created my magnetizing these metal bits. For the number one (1)
we work with 8 bits '. . . . . . . .'
Starting from the far right, the first bit is magnetized the other seven not. "M" = bit magnetized.
1 = ". . . . . . . M"
2 = ". . . . . . M ." 3 = ". . . . . . M M"
4 = ". . . . . M . ." 5 = ". . . . . M . M"
6 = ". . . . .M M ." 7 = ". . . . . M M M"
8 = ". . . . M . . ."

This is the only notation computers recognize.
The information after the period, in the file name, tels the Operating System what kind of file it is working with. In the following name examples, the * means any spelling.
*.doc = document, *.psp the file is used in Powerpoint. *.wav use in video, *.TMP
temporary file that the system creates but does not need!
Your file name data.txt requires 56 bytes for the characters and 1 byte for the period.

2007-03-13 09:35:42 · answer #2 · answered by Anonymous · 0 1

Actually, there's a lot more information stored about the file than just its name. Windows stores the time, permissions, attributes, owner, and other information, plus a pointer to its location on the drive. But creating the file doesn't usually take any additional disk space, because Windows uses space already reserved for the master file table (MFT). No storage space is allocated for a 0-byte file. However, add one byte to the file and it will take up a full cluster (4KB).

2007-03-13 09:34:16 · answer #3 · answered by injanier 7 · 0 0

fedest.com, questions and answers