c++ - Is it possible to delete a file that is opened by a process under windows? -


for testing , simulation purposes delete file open process.

the createfile docs state possible open file in mode (file_share_delete) allows file open handle pointing to deleted operation. (and tried , confirmed via createfile(file_share_delete) + deletefile.)

what know is, whether possible @ file opened without above mentioned flag deleted somehow?

as far understand deletefile docs not possible functions, as

the deletefile function fails if application attempts delete file open normal i/o or memory-mapped file.

is there other way delete file open, not have file_share_delete flag set?

there no way this.

the closest way schedule delete on reboot using movefileex target filename of null, , movefile_delay_until_reboot in dwflags parameter.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -