Previous Thread
Next Thread
Print Thread
Rate Thread
#103656 04/01/2002 7:07 PM
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
Hello

I am looking for a script that would CHMOD 777 all files/folders/sub folders etc. in a specified dir

do you know where I could find that ?

thanks

------------------
"If something can happen, it will" Murphy's Law


Do you believe in love at first sight,
or should I walk by again?
Sponsored Links
#103657 04/03/2002 8:05 AM
Joined: Aug 2000
Posts: 335
Member
Member
Offline
Joined: Aug 2000
Posts: 335
I can think of a couple of methods.

One way would be to use the system function:
[code][/code]Another way would be to recurse the directory tree yourself and use the Perl chmod function on each file. I've done similar things before; I thought there was a Perl module which does the recursion for you, but couldn't find it.

Online Perl doc: http://perldoc.com/

Be careful doing this.

#103658 04/04/2002 6:59 AM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
enjoy!

[RIP]

look below!

#103659 04/04/2002 1:05 PM
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
thanks !!
gona try it, usefull when you don't have telnet access smile


Do you believe in love at first sight,
or should I walk by again?
#103660 04/07/2002 2:57 PM
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
doesn't go pass the main dir frown


Do you believe in love at first sight,
or should I walk by again?
Sponsored Links
#103661 04/07/2002 4:35 PM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
what do you mean? I didnt understand ?

btw there is a little bug in my code above: it only reads the sub dirs in the directory. does not read sub_dir/sub_sub_dir/ etc...

here is the new one, added error control when chmoding:

[code][/code]

#103662 04/07/2002 4:38 PM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
but the first one *must* read *all* files in the dir and all subdirs...

#103663 04/09/2002 1:40 PM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
so, is it working?

#103664 04/09/2002 9:42 PM
Joined: Aug 2000
Posts: 335
Member
Member
Offline
Joined: Aug 2000
Posts: 335
jeologic, I haven't tried your script, but it appears to build an array of all the filenames (full paths), and then chmod the list. Since that could use a lot of memory (if there are a lot of subdirectories and files), do you think it would be better to chmod the files one at a time as they are found, rather than building the list?

#103665 04/10/2002 11:27 AM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
yes it builds an array of files, but also builds another array of directories...

You're right... that can be an option (chmod one by one), but this is not a multi-user thingy... so, I dont think that it will eat the memory and take the server down wink UBBDev has a lot of members as you know... A script I wrote opens & reads all this member files at once and builds "ubbdev haxxor" color files. And it does not take that long to do this in this busy site (but it takes a loooooong time in my old comp)...

A benchmark must be done to compare performance...

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)