Click to See Complete Forum and Search --> : Is it possible to specify where (physically on the hd) a file should be stored?


Barret
October 22nd, 2004, 09:02 AM
I want to save large amounts of data as fast as posible to the hard disk.
The problem is that im having trouble with real time recording of uncompressed video. Windows doesnt know that the files are going to be quite big so it stores it at a (random?) cluster on the harddisk, then the file becomes fragmented, since the harddisk isn't that fast this results in dropped frames.

Marc G
October 22nd, 2004, 09:22 AM
You should not simply 'stream' the data to a new file. Create the file first and tell windows how big it's gonna be (approximated) with SetFilePointer and SetEndOfFile. For example, use CreateFile to create the file, then use SetFilePointer to set the file pointer to 100 MB, then use SetEndOfFile to tell windows that you are going to create a 100 MB file. If you come in the neighborhood of the 100 MB, again use SetFilePointer and SetEndOfFile to enlarge the file with a new block of say 100 MB.

Barret
October 22nd, 2004, 09:26 AM
thanks!