Hello, I have a file that I use to save data when the system is running and I wish to save data to it but before saving, I want to erase its old content so at the end I can only have the latest content in the file. For some reason I would like to achieve that without close the file handle.
I first thought about using ZwSetInformationFile to set the size to 0 but I remember that its not recommended to play with file size so I was wondering If any of you that have been down the path could provide any help.
I awaiting for a response.
What I have tried:
I have already tired ZwSetInformationFile where my intention is to change the file size but I'm not sure that the way to do it.