Unix users have probably encountered the DD utility, which allows byte-by-byte copying from one file/device to another.
Personally, I most often use it in the following variants:
dd if=/dev/zero of=somefile bs=1M count=filesize
dd if=/dev/zero of=somefile bs=1M count=1 seek=filesize
What for? To create a file of a given size, consisting of zeros (/dev/zero).
But how do you create an empty file of a given size in Windows? After all, it certainly doesn't have the DD utility.
As a special case and an alternative to dd for this task, you can use the fsutil utility, which comes bundled with the operating system:
C:\> fsutil file createnew c:\myfile 1024000
In this example, we create an empty file filled with zeros and with a size of 1024000 bytes (almost 1MB).
Comments