http://bugs.winehq.org/show_bug.cgi?id=14914
--- Comment #37 from Alex Y. Shalimov ashalimov@gmail.com 2010-07-07 02:27:03 --- Actually, the first version of this program was platform-independent, using stdc API :-) But then I decided that we're more interested in exploring native Windows app behavior, and rewrote it with winapi. However, I've saved the previous version, and now performed the same experiments with it. It has one more command line param:
-posix-prealloc - use posix_fallocate instead for write-last-byte (for Linux only).
On Windows:
filetest2.exe (preallocation, random write) I've run it several times, and every time file had only 1 fragment.
filetest2.exe -write-only -sequential-write (no preallocation, sequential write) File has around 2000-2600 fragments. Perhaps this means my disk is quite fragmented with lot of small empty spaces; after defragmentation I think it will be much less.
filetest2.exe -write-only (no preallocation, random write) 2-3 fragments. Perhaps the first chunk was near the end, essentially preallocating the file.
Later I'll perform the same results on my home Linux; I'll also test if posix_fallocate is effective enough.