Voting

Please answer this simple SPAM challenge: max(one, nine)?
(Example: nine)

The Note You're Voting On

php at stock-consulting dot com
11 years ago
rename() fails with PHP4 and PHP5 under Windows if the destination file exists, regardless of file permission settings. I now use a function similar to that of ddoyle [at] canadalawbook [dot] ca, which first tries rename(), checks if it returned FALSE and then uses copy()/unlink() if it failed.

However, copy() is, unlike rename(), NOT useable for "atomic updates". Another process may actually access the destination file while copy() is working. In such a case, the other process with perceive the file as empty or with incomplete content ("half written").

<< Back to user notes page

To Top