append v 1: add to the very end; "He appended a glossary to his novel where he used an invented language" [syn: add on, supplement,
affix] 2: fix to; attach; "append a charm to the necklace" [syn: tag on, tack on, hang on] 3: state or say further; " `It doesn't matter,' " he
supplied" [syn: add, supply]
What you describe is not appending, but prepending. Filesystems do NOT support prepending to an existing file.
To get the results you want, do this:
Open the file for read. Read it into a variable. Close it.
Open the file for write. Write the new information. Then write the information you saved in the variable.