it is possible. i read in the comments on the PHP manual that you can use
$fp = fopen("filename.txt","aw");
this apparantly combines the append function, as in not deleting the contents of the file, and also the write function, which places the file pointer at the beginning of the file.
i haven't tried it but i think it will work. saves having to re-write the entire file :-)