O Great PHP Leaders;

I got this from the php maual to "copy a directory, and ALL
subdirectories"but cannot make it work. Tried it on two servers. . . It will
not even "mkdir" unless I comment out the function line and the last event
handler (I use "mkdir" in my other scripts just fine, but I made those) and
according to the manual the function is valid. <blank look on face and
scratches head>

Thanks in advance.

$from_path = ("$from");
$to_path = ("$to");
function rec_copy ($from_path, $to_path) {
mkdir($to_path, 0777);
$from_path = getcwd();
if (is_dir($from_path)) {
chdir($from_path);
$handle=opendir('.');
while (($file = readdir($handle))!==false) {
if (($file != ".") && ($file != "..")) {
if (is_dir($file)) {

rec_copy ($from_path.$file."/", $to_path.$file."/");
chdir($from_path);
}
if (is_file($file)){
copy($from_path.$file, $to_path.$file);
}
}
}
closedir($handle);
}
}
header( "Location: index.php" );


Loren Wolsiffer



____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to