Hello.
If we want to modify an existing file by deleting its content this is the only basic solution.
(a) copy the data from the source file to a target file discarding the unrequired data.
...