Skip to content

Quickest way to make a large "empty" file on disk?

2 messages · Jonathan Greenberg, Simon Urbanek

#
On Sep 28, 2012, at 12:44 PM, Jonathan Greenberg wrote:

            
I can't speak for Rui, but the difference between seeking and explicit write is that the FS can optimize the former by not actually writing anything to disk (which is why it's so fast on some OS/FS combos). However, what this means that the layout on the disk may not be sequential depending on the write patterns of the actual data blocks, because the FS may keep a mask of unused blocks and don't write them. But that is just a FS issue and thus varies vasty by OS and FS. For your use this probably doesn't matter as you probably don't need to stream the resulting file at the end.
Quick search in my mail shows issues that were related to what Windows reports as the seek location on text files when querying. AFAICS it did not affect the side-effect of seek which is what you're interested in.

Cheers,
Simon