CHMOD Batch - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21) +---- Thread: CHMOD Batch (/showthread.php?tid=2597) |
CHMOD Batch - zone - 11-06-2009 Credits and Source: http://www.dreamincode.net/ Name: CHMOD Batch Description: This function lets you batch chmod an array of files or folders. Snippet: PHP Code: <?php Instructions: This function is based on the file_search class: http://www.dreamincode.net/code/snippet930.htm Set file and dir permissions appropriately. This uses php's chmod function, which requires that the permission setting be prefixed with a leading 0 as in the example. Read more at http://www.php.net/chmod At the bottom is the $search object using the file_search class. Read specifications in the Advanced File Search snippet to learn how to use this. Following that is two uses of the chmod_batch function, first for files, second for directories. You can do both or comment out one or the other. Thankyou for your reading, be happy always |