summaryrefslogtreecommitdiff
path: root/shell/bin/chmod.php
diff options
context:
space:
mode:
Diffstat (limited to 'shell/bin/chmod.php')
-rw-r--r--shell/bin/chmod.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/shell/bin/chmod.php b/shell/bin/chmod.php
new file mode 100644
index 0000000..ca66f56
--- /dev/null
+++ b/shell/bin/chmod.php
@@ -0,0 +1,13 @@
+<?php
+function main($args) {
+ $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));
+ }
+ }
+} \ No newline at end of file