“size on disk” is zero for non-zero file in windows 8?

前端 未结 2 1498
后悔当初
后悔当初 2021-01-17 16:33

I found there are some files on my disk, which
1) the real size is not zero, but it is small, around 500 bytes
2) the \"size on disk\" shows zero when you check its

相关标签:
2条回答
  • 2021-01-17 16:40

    Files in NTFS consist of (at least one) file record in the master file record table (called MFT - each file record consists of attributes like name, file information, etc.) Data are usually located in one or more clusters on disk. The file record in the MFT contains references to those clusters (called a non-resident attribute). When the data size is really small, even its data are within the MFT record - the data attribute is resident. Thus NTFS doesn't have to allocate any clusters. Size on disk is the number of allocated clusters * size of a cluster, so if the data attribute is resident, size on disk is zero. If you reach the maximum size for the file record, the data attribute is made non-resident and NTFS allocates the first cluster, thus size on disk is 1 cluster - 4096 bytes.

    0 讨论(0)
  • 2021-01-17 16:45

    This is not specific to Windows 8 (so I modified your question). It is true of all NTFS managed by Microsoft's filesystem driver.

    I can't imagine why you would want to disable this type of efficiency: it is a particularly excellent feature since many computer files tend to be small.

    I have confirmed that NT versions up to XP NT do not move the data to the MFT record (and release the cluster(s)) if the file shrinks. So you could append some data to such files to make them at least 1024 bytes, and then truncate them back to the original size.

    0 讨论(0)
提交回复
热议问题