Recursive chmod function

They have: 218 posts

Joined: Apr 2001

I want to change all directory/subdirectory folder attributes (within one folder) to 0777. Any PHP recursive functions that do this?

Thanks,

TM

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

system("chmod 0777 ./*");

They have: 218 posts

Joined: Apr 2001

That didn't work. I'm trying to transfer folders that had 0777 attributes from one server to another. The 0777 attributes are getting lost when I transfer them.

How can I retain the attributes or reset them?

Thanks,

TM

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

You can manually chmod the directories in most ftp applications. Worst case scenario.

They have: 218 posts

Joined: Apr 2001

Too many folders to do it manually.... Wink

Chroder's picture

He has: 91 posts

Joined: Mar 2004

TonyMontana wrote: Too many folders to do it manually.... Wink

FlashFXP has a recursive CHMOD feature. (Right click, CHMOD, "apply changes to all subfolders and files")

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

I think Mark's suggestion will work with the following change:

system("chmod -R 0777 ./*");

-Greg

They have: 218 posts

Joined: Apr 2001

Quote: FlashFXP has a recursive CHMOD feature. (Right click, CHMOD, "apply changes to all subfolders and files")

Thanks Chroder, that worked great.

TM

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

oops... ya.. forgot the -R

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.