Appending variablesl to a text file?

I have flash files running on an stand alone display monitor. I would like the flash program to get the date everytime the file runs and append the date and filename of the flash file to a text file to log when that file ran. Any suggestions for a action script?
Still running Flash 4 but willing to change to 5 if it would make things easier.
Thanks in advance.