ID: 48975 Updated by: paj...@php.net Reported By: celkaprog at gmail dot com -Status: Assigned +Status: Feedback Bug Type: Filesystem function related Operating System: win32 only - Windows 7 PHP Version: 5.3.0 Assigned To: pajoye New Comment:
Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [2009-07-19 14:27:14] celkaprog at gmail dot com It's only works in this way: chdir("../../images/cms/original"); symlink(getcwd()."\\".$file_id.".jpg",getcwd()."\\".$newfid.".jpg"); chdir("../../../foo/bar"); ($file_id=1 $newfid=25, 1.jpg exitst,and in this way 25.jpg will esists and will be good to.) And it works in this way: chdir("../../images/cms/original"); symlink(getcwd()."\\".$file_id.".jpg",$newfid.".jpg"); chdir("../../../foo/bar"); (Here I understand that the second parameter i don't need path only the new filename?!) And it doesn't work in this way(in the original way): symlink("../../images/cms/original/".$fajl_id.".jpg","../../images/cms/original/$newfid.".jpg"); So i thought that it should be work in this way: symlink("../../images/cms/original/".$fajl_id.".jpg", $newfid.".jpg"); But it doesn't work.I must chdir() to the directory and after chdir() back ------------------------------------------------------------------------ [2009-07-19 14:05:17] paj...@php.net Run the script in CLI as admnistrator please. But I'm 100% sure it works anyway, I just tested again on win7, 2008 and vista. ------------------------------------------------------------------------ [2009-07-19 14:01:02] celkaprog at gmail dot com That was my first step to change the order. Now I changed and still: Warning: symlink() [function.symlink]: Could not fetch file information(error 3) in E:\\foo\bar\tree_copy.php on line 148 Here is the code what is executing: symlink('../../images/cms/original/1.jpg','../../images/cms/original/12.jpg'); ../images/cms/original/1.jpg is exists,but 12.jpg is not created. ------------------------------------------------------------------------ [2009-07-19 13:55:30] celkaprog at gmail dot com I logined into the administrator account. Started apache+php. But the problem is the same. I opened a command prompt. e:\foo\bar>mklink 5.jpg 1.jpg then 5.jpg created and i can view with irfanview. e:\anything\something>mklink "../../foo/bar/5.jpg" "../../foo/bar/1.jpg" (without " it says invalad parameter: --) then 6.jpg created and I cannot open it with irfanview and cannot see it's content(Total commander Lister(F3)) Interesting. ------------------------------------------------------------------------ [2009-07-19 13:46:12] paj...@php.net Doh, I misread your code. Please read again the doc about symlink, the arguments in your code are in the wrong order (then the error is actually clear). ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/48975 -- Edit this bug report at http://bugs.php.net/?id=48975&edit=1