summaryrefslogtreecommitdiff
path: root/shell/bin/chmod.php
blob: b74a9cad0e41603ba2af8746ea463266458f4882 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
class p_chmod extends prog {
	public static function main($args, $env) {
		$me = array_shift($args);
		if (count($args)<2) {
			echo $me.': usage: '.$me.' MODE FILE1 [FILE2 [FILE2]]'."\n";
			return 1;
		} else {
			$mode = array_shift($args);
			foreach ($args as $file) {
				chmod($file,octdec($mode));
			}
		}
	}
}