in reply to Re: Limitations to chmod and performance
in thread Limitations to chmod and performance

Using the command find instead of File::Find is not a bad thing per se. But as you do it, you will fork a chmod command per matching file. Since you are concerned by performance issue, let us say it may be better to optimize by bundling as much files as possible in an exec command by using xargs:

find /the/dir -name \*.dat -not -perm 644 | xargs chmod 644

To be on the safe side and to deal correctly with weird file names (like windoze filenames with blanks), it is even better to use the null character as a file separator:

find /the/dir -name \*.dat -not -perm 644 -print0 | xargs -0 chmod 644

-- stefp