From: Ilia Alshanetsky Date: Sat, 31 May 2003 00:32:45 +0000 (+0000) Subject: Fixed bug #23913 (make rename() work across partitions on *nix) X-Git-Tag: RELEASE_1_0_2~495 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32a0044a21c71ef58fba4b318e7068c414ea50e0;p=php Fixed bug #23913 (make rename() work across partitions on *nix) --- diff --git a/ext/standard/file.c b/ext/standard/file.c index f31c3718de..e552cb7758 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1391,6 +1391,14 @@ PHP_FUNCTION(rename) ret = VCWD_RENAME(old_name, new_name); if (ret == -1) { +#ifdef EXDEV + if (errno == EXDEV) { + if (php_copy_file(old_name, new_name TSRMLS_CC) == SUCCESS) { + VCWD_UNLINK(old_name); + RETURN_TRUE; + } + } +#endif php_error_docref2(NULL TSRMLS_CC, old_name, new_name, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; }