Deleting or Renaming a file using an open handle

后端 未结 1 550
迷失自我
迷失自我 2021-01-11 09:40

The Windows API function CreateFile function allows you to specific the desired access. There are three options read, write and delete. If you get a handle from CreateFile

相关标签:
1条回答
  • 2021-01-11 10:24

    In Windows Vista there is that function SetFileInformationByHandle, that can do what you need.

    In previous versions of Windows there is no such function, but you have the equivalent native, not quite public function NtSetInformationFile.

    I have no experience with these functions, nor a Windows machine to test them, so I cannot show you the code, but that should not be so difficult.

    The general disclaimer about native Windows functions apply, of course.

    0 讨论(0)
提交回复
热议问题