Jump to content

PHP CHMOD() Question


harshpandya

Recommended Posts

Hi All, This is my code: chmod("test.xml",0666);Now problem is it does not give rw- rw- rw permission to my file. Note: test.xml is actually linking to another file called test2.xml. I thought if i change permission on test.xml, it should change the permission of test2.xml file also. But it does not.. So how do i change permission of test2.xml. test.xml links to test2.xml and test.xml has lrwx-rwx-rwx permissionPlease help, Thanks,

Link to comment
Share on other sites

Err... Does this work?

chmod("test2.xml",0666);

This is an operating system setting, and the operating system probably regards a file and a link to a file as separate entities. I ran into this when I was trying to set up a test server on my Linux installation. If I linked to a write-protected folder from a folder in my home directory, I couldn't use it; if I linked to the folder in my home directory from the write-protected folder, I could use it.

Link to comment
Share on other sites

test.xml links to test2.xml and test.xml has lrwx-rwx-rwx permissionwhile i just created temp.xml which has simple rw-r - r permission and does not link to anythingthats the only difference i can notice. One more thing - if i do ssh in the system and then do chmod from CMD prompt it changes the permission for test.xml but by using PHP chmod it does not change permission.while for temp.xml both the options work fine. please help Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...