Erase the contents of a file.
I had been using cat /dev/null > /path/to/file for a long time. Whlie reading through a friend’s shell script for creating Amazon EC2 images I found out another way of erasing the contents of a file. > /path/to/file That results in the open system call being called with the O_TRUNC flag. open(“/path/to/file”, O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666)









