Originally posted by iclinux
BTW, is there any c API?
Now I understand, I think. You want to do this in C. Examine the manpage for fopen. You'll need to open the file in write mode, not append mode. For example:
fopen ("path_to_file", "w");
Opening the file this way will zero its contents.