Just call truncate
or ftruncate
to cut the file to zero bytes. Then write the line you want. You don’t need to close or re-open the file, you can use your existing handle.
2
solved C system calls, delete the file
Just call truncate
or ftruncate
to cut the file to zero bytes. Then write the line you want. You don’t need to close or re-open the file, you can use your existing handle.
2
solved C system calls, delete the file