Browse Source

Fixed bug #23913 (make rename() work across partitions on *nix)

migration/unlabaled-1.3.2
Ilia Alshanetsky 23 years ago
parent
commit
32a0044a21
  1. 8
      ext/standard/file.c

8
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;
}

Loading…
Cancel
Save