1--TEST-- 2Test rename() function: usage variations-6 3--SKIPIF-- 4<?php 5if (substr(PHP_OS, 0, 3) != 'WIN') die('skip.. for Windows'); 6if (!function_exists("symlink")) die("skip symlinks are not supported"); 7$ret = exec('mklink rename_variation13tmp.lnk ' . __FILE__ .' 2>&1', $out); 8if (strpos($ret, 'privilege')) { 9 die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); 10} 11?> 12--FILE-- 13<?php 14 15$tmp_file = __FILE__.".tmp"; 16$tmp_link = __FILE__.".tmp.link"; 17$tmp_link2 = __FILE__.".tmp.link2"; 18 19touch($tmp_file); 20symlink($tmp_file, $tmp_link); 21rename($tmp_link, $tmp_link2); 22 23clearstatcache(); 24 25var_dump(readlink($tmp_link)); 26var_dump(readlink($tmp_link2)); 27var_dump(file_exists($tmp_file)); 28 29@unlink($tmp_link); 30@unlink($tmp_link2); 31@unlink($tmp_file); 32 33echo "Done\n"; 34?> 35--EXPECTF-- 36Warning: readlink(): %s in %s on line %d 37bool(false) 38string(%d) "%srename_variation6-win32.php.tmp" 39bool(true) 40Done 41