I have a file with some of user1\'s data. I want to use the same file for user2 by clearing the content of the file.
My idea is that when a new user comes, data of
There are two ways:
1. fd=open(filename,O_RDONLY | O_WRONLY | O_TRUNC); 2. [cat /dev/null > filename] for BASH. It can be directly used in c program using [system()] system call. system("cat /dev/null > filename");