copy directory on server??


#1

This has me a little stumped. Is there a way to copy a whole directory on the server, i.e. make a duplicate of it?

copy() reports a permissions error because the directory has files inside it. permissions aren’t a problem because I can happily delete directories even if they have files in, just not copy, apparently.

Is there a simple duplication method, or will I have to do it the long way with mkdir() and by copying over each and every file?

Thanks in advance.


#2

I am not sure if there is a specific PHP function that will do what you ask (maybe Bane might know), however you could try using the shell_exec command and run it that way.

http://us3.php.net/manual/en/function.shell-exec.php


#3

Thanks, I’ll check it out.