|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-07-19 07:41 UTC] celkaprog at gmail dot com
Description:
------------
Hi
I am using PHP 5.3.1.0 and Windows 7
Symlink doesn't work for me:
Warning: symlink() [function.symlink]: Could not fetch file
information(error 3) in E:\htdocs\foo\bar\tree_copy.php on line 148
(5.3.0 This function is now available on Windows platforms (Vista,
Server 2008 or greater).)
What are the error codes?
Reproduce code:
---------------
---
From manual page: function.symlink
---
if (is_readable("../../foo/bar/2.jpg")) echo "readable";
symlink("../../foo/bar/2.jpg","../../foo/bar/1.jpg");
../../foo/bar/1.jpg is exists and the path is correct.
Expected result:
----------------
readable
2.jpg what is symlink for 1.jpg.
Actual result:
--------------
readable
Warning: symlink() [function.symlink]: Could not fetch file
information(error 3) in E:\htdocs\foo\bar\tree_copy.php on line 148
and no 2.jpg
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 00:00:01 2025 UTC |
Description: ------------ Hi I am using PHP 5.3.1.0 and Windows 7 Symlink doesn't work for me: Warning: symlink() [function.symlink]: Could not fetch file information(error 3) in E:\htdocs\foo\bar\tree_copy.php on line 148 (5.3.0 This function is now available on Windows platforms (Vista, Server 2008 or greater).) What are the error codes? Reproduce code: --------------- --- From manual page: function.symlink --- if (is_readable("../../foo/bar/1.jpg")) echo "readable"; symlink("../../foo/bar/2.jpg","../../foo/bar/1.jpg"); ../../foo/bar/1.jpg is exists and the path is correct. Expected result: ---------------- readable 2.jpg what is symlink for 1.jpg. Actual result: -------------- readable Warning: symlink() [function.symlink]: Could not fetch file information(error 3) in E:\htdocs\foo\bar\tree_copy.php on line 148 and no 2.jpgSorry for the double post but one important thing is written wrong in my letter.(if (is_readable("../../foo/bar/2.jpg")) echo "readable";) (/foo/bar/1.jpg is the correct and i use it in my code not 2.jpg)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.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