>Under UNIX (where you can rename onto an extant file and so I used link), you will have to remove both the link and the link's target.
Couldn't you do
<?php
if ($newFileCreated) {
unlink ($sysFileName);
return $newFileName;
}
?>
and get the same semantics as the windows version?