[QUESTION] copy();

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

[QUESTION] copy();

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I seriously doubt it.. why not try it?
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Post 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...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

why not create your own?
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Post by Dale »

feyd wrote:why not create your own?

eh? What do you mean?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

create your own function to copy the contents of one folder to another.
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Post 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...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it's not hard... opendir() / glob() with some copy() calls... :roll:
MrKnight
Forum Newbie
Posts: 22
Joined: Fri Jan 28, 2005 8:54 am
Location: Another Planet

Post by MrKnight »

Post Reply