Page 1 of 1

[QUESTION] copy();

Posted: Fri Feb 04, 2005 8:35 am
by Dale
Can

Code: Select all

<?php
copy();
?>
move whole folders? With all its contents to? AND keep an original folder still where it was?

Posted: Fri Feb 04, 2005 8:39 am
by feyd
I seriously doubt it.. why not try it?

Posted: Fri Feb 04, 2005 8:47 am
by Dale
I tried

Code: Select all

<?php 
copy ("users", "dalehay") or die ("Could not move"); 
?>
and placed it in the main directory.

I went to ...co.uk/tester.php and it just says
Warning: copy(dalehay): failed to open stream: Is a directory in /home/dframe/public_html/tester.php on line 2
Could not move
So i take it there isnt a way...

Posted: Fri Feb 04, 2005 8:50 am
by feyd
why not create your own?

Posted: Fri Feb 04, 2005 8:54 am
by Dale
feyd wrote:why not create your own?

eh? What do you mean?

Posted: Fri Feb 04, 2005 8:55 am
by feyd
create your own function to copy the contents of one folder to another.

Posted: Fri Feb 04, 2005 8:56 am
by Dale
feyd wrote:create your own function to copy the contents of one folder to another.

Ignore what my CT says, but im still a n00b. But i'll have a snoop around on the internet and see if anyone has done it themseleves...

Posted: Fri Feb 04, 2005 8:59 am
by feyd
it's not hard... opendir() / glob() with some copy() calls... :roll:

Posted: Sat Feb 05, 2005 5:54 am
by MrKnight