IDOXLR8 Posted July 4, 2009 Share Posted July 4, 2009 If you have ever needed to copy a bunch of files or folders there is an easy way of doing this with little effort. I wrote this script to manage new account folder creation on our local intranet and it works great. I made a template folder containing all the needed files and folders and used this script when setting up a new user. Enjoy... <?php function recurse_copy($src,$dst) { $dir = opendir($src); @mkdir($dst); while(false !== ( $file = readdir($dir)) ) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ) { recurse_copy($src . '/' . $file,$dst . '/' . $file); } else { copy($src . '/' . $file,$dst . '/' . $file); } } } closedir($dir); } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.