LemonInflux Posted September 15, 2007 Share Posted September 15, 2007 OK, in a matter of speaking, I'm building a script that builds itself. It's working fine, but I was struck with a thought; for some of the files that will be script-created, they will need to be 777 CHMOD value. So is there a code that checks a file's CHMOD value? I basically want to say 'if $file has 777 CHMOD do this, else do this'. I can do the if bit, I was just wondering how I would do the CHMOD bit? Quote Link to comment https://forums.phpfreaks.com/topic/69460-check-chmod-value/ Share on other sites More sharing options...
wildteen88 Posted September 15, 2007 Share Posted September 15, 2007 If you want to see if a file/folder is writeable, readable or executable use is_writeable, is_readable or is_executable Quote Link to comment https://forums.phpfreaks.com/topic/69460-check-chmod-value/#findComment-349000 Share on other sites More sharing options...
LemonInflux Posted September 15, 2007 Author Share Posted September 15, 2007 ok. Also, I was just browsing, and found this: chmod("path/to/file.something", 0777); would that change file.something's CHMOD value to 777? Quote Link to comment https://forums.phpfreaks.com/topic/69460-check-chmod-value/#findComment-349001 Share on other sites More sharing options...
wildteen88 Posted September 15, 2007 Share Posted September 15, 2007 Yes. It will attempt to change the chmod value of a specified file/folder. Please read the notes carefully for this function in the manual Quote Link to comment https://forums.phpfreaks.com/topic/69460-check-chmod-value/#findComment-349003 Share on other sites More sharing options...
LemonInflux Posted September 15, 2007 Author Share Posted September 15, 2007 Read it. Note: This function will not work on remote files as the file to be examined must be accessible via the servers filesystem. What does this mean? I can't change the CHMOD via PHP? Quote Link to comment https://forums.phpfreaks.com/topic/69460-check-chmod-value/#findComment-349011 Share on other sites More sharing options...
darkfreaks Posted September 15, 2007 Share Posted September 15, 2007 keep scrolling down there is a sample chmod via ftp script. Quote Link to comment https://forums.phpfreaks.com/topic/69460-check-chmod-value/#findComment-349024 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.