[Wellington-pm] chmod, chown and friends.
Peter Love
Peter.Love at netkno.com
Fri Aug 20 02:49:08 CDT 2004
> If not, is there a cool way of simulating the shell command:
>
> chown -R user:group directory (and similar)?
You might want to look at File::Find.
Briefly, it can call a function every time it finds a file in specified
directories.
E.g., something like:
use File::Find;
find(\&mychmod,$directory);
sub mychmod {
... do some stuff ..
... current file is in $_ ...
}
Also note something like: It does a chdir as it goes. Current directory
and full file pathname are in $File::Find::dir and $File::Find::name
More information about the Wellington-pm
mailing list