At first you should check the file permissions with the fileperms/fileowner/...-functions. You can't write a file, if you haven't the permissions to do so.
You can copy a file with the
copy-function and you can rename a file with the
rename-function (quite simple to remember

). You can delete a file with the
unlink function (works under unix-systems and under windows since php4, I think).
mfg, Beefy.