ID: 42038 Updated by: [EMAIL PROTECTED] Reported By: kraghuba at in dot ibm dot com -Status: Open +Status: Feedback Bug Type: Filesystem function related Operating System: MacOSX, FreeBSD PHP Version: 5CVS-2007-07-18 (snap) -Assigned To: +Assigned To: fb-req-jani New Comment:
I'm guessing this should be fixed in PHP_5_3 and HEAD by the commit by Dmitry? Previous Comments: ------------------------------------------------------------------------ [2007-07-19 03:21:44] kraghuba at in dot ibm dot com The reference to testcase symlink_link_linkinfo_is_link_variation6.phpt is wrong. The write testcases to check are : ext/standard/tests/file/readlink_realpath_basic1.phpt ext/standard/tests/file/readlink_realpath_variation1.phpt ext/standard/tests/file/readlink_realpath_variation2.phpt The similar failure is also noticed on FreeBSD. (FreeBSD - FreeBSD lindsay.php.is 6.2-STABLE FreeBSD 6.2-STABLE #1: Thu Jun 28 22:12:54 CEST 2007 ) MACOSX details: Darwin - Darwin thought 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 ------------------------------------------------------------------------ [2007-07-18 17:16:51] kraghuba at in dot ibm dot com Description: ------------ realpath() doesn't resolve symlink and returns the link file name when input path is a link path. As per the documentation at http://in.php.net/manual/en/function.realpath.php, The resulting path will have no symbolic link, '/./' or '/../' components. Applicable to php5.2.4 only on MacOS X. Please check testcase symlink_link_linkinfo_is_link_variation6.phpt. Reproduce code: --------------- <?php $file_path = dirname(__FILE__); $filename = "$file_path/file.tmp"; $linkname = "$file_path/link.tmp"; $fp = fopen($filename, "w"); fclose($fp); symlink($filename, $linkname); var_dump( realpath($linkname) ); unlink($linkname); unlink($filename); ?> Expected result: ---------------- string(%d) "%s/file.tmp" Actual result: -------------- string(%d) "%s/link.tmp" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42038&edit=1