You are here: rename() on Windows « PHP Programming Language « IT news, forums, messages
rename() on Windows

Posted by howa on 11/13/06 16:28

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)) {
unlink($oldfile);
return TRUE;
}
return FALSE;
}
return TRUE;
}

but are there any better workaround?

thanks.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация