Assuming an Unix operating system...
I was going to say truncate but first i tried a kernel trace which indeed opens and closes the file. That leads me to say that redirecting stdin or /dev/null would do the same.
Only way seems to be rm -f file && touch file. Then again (seen via another kernel trace), touch also opened and closed the file.
Well, i am out of ideas...
In reply to Re: How to erase the file content
by parv
in thread How to erase the file content
by kamesh3183
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |