Copying folders and their files?

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
Mr. Tech
Forum Contributor
Posts: 205
Joined: Tue Feb 11, 2003 4:18 pm
Location: Australia

Copying folders and their files?

Post by Mr. Tech »

Hi!

I am writing a script and need some help with moving a folder and it's files, into another folder. I looked at: http://au.php.net/manual/en/ref.filesystem.php and found this:

Code: Select all

<?php
copy('testdir', 'test') ;
?>
It's suposed to move testdir into test but I get this error:

Warning: Unable to open 'testdir' for reading: Permission denied in c:\program files\easyphp\www\dir\index.php on line 34

Woulkd this have something to do with chmod? Or is it the wrong way to do it?

Thanks
Tubbietoeter
Forum Contributor
Posts: 149
Joined: Fri Mar 14, 2003 2:41 am
Location: Germany

Post by Tubbietoeter »

check this link: http://de.php.net/manual/de/function.copy.php


did you check on the permissions? and try to give the whole paths to the folders to the function.
Mr. Tech
Forum Contributor
Posts: 205
Joined: Tue Feb 11, 2003 4:18 pm
Location: Australia

Post by Mr. Tech »

Tried both... does anyone have something like this that works?
Post Reply