I now want to operate a file already exists, assuming that the file size of 3 k,
And I want to write the contents of the accounts for only 2 k,
This in FileWrite API functions, such as how to realize?
I know that after the first remove to Create,
But it should be low efficiency,
I want to delete the end-of-file spare parts directly, how should do?
CodePudding user response:
CreateFile to open the file, after you have written in FileWrite, reoccupy Windows API: SetEndOfFile, finally the CloseHandle