rename() on Windows

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

on windows, the rename() function will throw an error if target file
already exist, currently, i need to use, e.g.

function rename_win($oldfile, $newfile) {

    if (!@ rename($oldfile, $newfile)) {
        if (copy($oldfile, $newfile)) {
            return TRUE;
        return FALSE;
    return TRUE;

but are there any better workaround?


Site Timeline