Force filesystem sync after delete

1.3k views Asked by At

I'd like to load a file such that the contents are either in memory or on disk but not both. By doing a simple open, read, and delete, this should accomplish the task. But it seems that it's up to the OS to decide when to flush the delete command to hardware. In the case of linux, a call to sync() should accomplish this. In the world of Windows, the closest you can get is FlushFileBuffers(), which takes a handle. Whend deleting a file, you don't use handles, just paths. Is there a way to force Windows to flush a delete request to disk rather than queuing or caching it?

0

There are 0 answers