Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why isn't this symlink script working?

Status
Not open for further replies.

verbatim1

Programmer
Apr 18, 2005
58
US
I was told that the code below would create symlinks in php.
Code:
$path = "/home/user/orig_file";
$path_new = "/home/user/link_file";

symlink($path_new, $path);

I 'reconfigured' it to work to my needs, but it doesnt.

the paths i am trying to link are below:

Code:
$path = "/home/some/dep/";
$path_new = "/home/mem/main/users/{$username}/";

symlink($path_new, $path);

the script is in the /home/mem/main/ directory by the way
 
so i figured out that i had the path order reversed.

Now i am trying to figure out how i would go about setting the permissions to 0755 for the $path_new.

Code:
symlink ($path, $path_new, 0755) didnt work for me.
 
Symbolic links have ownership, but no permissions.
Anything you do on a symbolic links points to the actual file/directory. If you want to change the permissions change them at the point where the link points to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top