Hello All!
How can I automatically change permissions just for files in current directory and not for other directories. I suppose that 'chmod -R 664 .'
will change permission to all current directory content..
xolmc
0
Newbie Poster
Recommended Answers
Jump to Postget the contents of the folder and use "is_dir()" in an "if" statement so that you would chmod files only
:)
Jump to Posttry something like this
$files = scandir($dir_path); foreach ($files as $file) { if(!is_dir($file)) { chmod($file, 0664) } }
All 5 Replies
hashinclude
0
Junior Poster
xolmc
0
Newbie Poster
hashinclude
0
Junior Poster
xolmc
0
Newbie Poster
hashinclude
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.