Question: Every time I start Photoshop, it immediately creates a 2GB temporary file on the hard drive where the cache is located. It’s a platter drive, and I don’t hear any of the hard-drive noises that would normally be associated with writing 2GB of data. Is it possible to create an empty placeholder file with a “fake” size to reserve space in case it actually needs to cache some data later?
Answer: There are two different ways this can be accomplished on an NTFS volume.
The SetEndOfFile function, on NTFS file systems, reserves the disk space for the file but does not fill that space with anything. There might be a little disk activity here from updating the NTFS bookkeeping. When a program does anything to a file past the last byte that has previously been written, NTFS scribbles over the run between the last written (last “valid”) byte and the requested byte (to avoid security problems) and updates the valid data pointer.
Then there are sparse files. Unlike normal files extended with SetEndOfFile, NTFS keeps track of which sectors have actual data in them rather than just which byte is the last one with valid data. Long runs of zeroes where nothing has been written are not stored on the physical disk.
You can check whether a file is sparse with fsutil sparse queryflag followed by the path to the file. If it’s not sparse, the program is using the first approach.
Further reading: Why does my single-byte write take forever?