http://bugs.winehq.org/show_bug.cgi?id=14914
--- Comment #12 from Marcus Blomenkamp mblomenk@gmx.de 2008-08-21 03:51:05 --- @Vitaliy
The files are not corrupt, all file content is fine. But when the application is finished, the files are completely fragmented. That is because the application writes to the file in random fashion. The application developers knew that of course, so they 'preallocated' (probably the wrong word?) the file by specifying the final size with the following Windows VFW API calls:
CreateFileW, SetFilePointer, SetEndOfFile
This sequence i have captured in the first attachment. This sequence is quaranteed by Windows API specifiction to create a contiguous file preferably. But under Linux/Wine this sequeny results in creation of a 100% sparsefile. Which means that when later on the application writes to the file in randon fashion, file blocks are allocated in the underlying storage in random order as well. Inevitably leading to fragmentation.
As i explained in the last paragraph of my previous comment: It is a question of what Wine wants to do. Does it want to export Windows VFS API semantics or does it want to pass Linux filesystem semantics down to the application?