From: Ilia Alshanetsky Date: Sat, 31 May 2003 00:33:06 +0000 (+0000) Subject: MFH: Fixed bug #23913 (make rename() work across partitions on *nix) X-Git-Tag: php-4.3.3RC1~141 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=931f3abe4eea8b6ea0e65f119f042e9aec96709d;p=php MFH: Fixed bug #23913 (make rename() work across partitions on *nix) --- diff --git a/ext/standard/file.c b/ext/standard/file.c index 489c96074c..0133fa510d 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1867,6 +1867,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; }