Permalink
Browse files

chown

  • Loading branch information...
0 parents commit ca2a51a93d11e06d24359db9ec4dba68b25dd492 @tlevine committed Apr 11, 2013
Showing with 24 additions and 0 deletions.
  1. +22 −0 chown.php
  2. +2 −0 readme.md
@@ -0,0 +1,22 @@
+
+<?php
+
+if ($handle = opendir('/path/to/files')) {
+ while (false !== ("ntry = readdir($handle))) {
+ echo "$entry\n";
+ }
+ closedir($handle);
+}
+
+// File name and username to use
+// $file_name= "foo.php";
+// $path = "/home/sites/php.net/public_html/sandbox/" . $file_name ;
+// $user_name = "root";
+//
+// // Set the user
+// chown($path, $user_name);
+//
+// // Check the result
+// $stat = stat($path);
+// print_r(posix_getpwuid($stat['uid']));
+?>
@@ -0,0 +1,2 @@
+Some helpful things for
+[NearlyFreeSpeech.NET](https://nearlyfreespeech.net)

0 comments on commit ca2a51a

Please sign in to comment.