Updated: April 17, 2012
Applies To: Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7, Windows Server 2003 R2, Windows Server 2008 R2, Windows Server 2000, Windows Server 2012, Windows 8
Manages sparse files.
For examples of how to use this command, see Examples.
Scans a file and searches for ranges that may contain nonzero data.
Marks the indicated file as sparse.
Fills a specified range of a file with zeros.
Specifies the full path to the file including the file name and extension, for example C:\documents\filename.txt.
Specifies the offset within the file to mark as sparse.
Specifies the length of the region in the file to be marked as sparse (in bytes).
A sparse file is a file with one or more regions of unallocated data in it. A program will see these unallocated regions as containing bytes with the value zero, but no disk space is used to represent these zeros. All meaningful or nonzero data is allocated, whereas all nonmeaningful data (large strings of data that is composed of zeros) is not allocated. When a sparse file is read, allocated data is returned as stored, and unallocated data is returned, by default, as zeros, in accordance with the C2 security requirement specification. Sparse file support allows data to be deallocated from anywhere in the file.
In a sparse file, large ranges of zeroes may not require disk allocation. Space for nonzero data will be allocated as needed when the file is written.
Only compressed or sparse files can have zeroed ranges known to the operating system.
If the file is sparse or compressed, NTFS may deallocate disk space within the file. This sets the range of bytes to zeroes without extending the file size.