How to check successful copy() function execution in php?

Posted by OM The Eternity on Stack Overflow See other posts from Stack Overflow or by OM The Eternity
Published on 2010-05-06T11:44:29Z Indexed on 2010/05/06 11:48 UTC
Read the original article Hit count: 142

Filed under:
|

How to check successful copy() function execution in php?

I am using the following code:

<?
function full_copy( $source, $target ) {
    if ( is_dir( $source ) ) {
        @mkdir( $target );
        $d = dir( $source );
        while ( FALSE !== ( $entry = $d->read() ) ) {
            if ( $entry == '.' || $entry == '..' ) {
                continue;
            }
            $Entry = $source . '/' . $entry; 
            if ( is_dir( $Entry ) ) {
                full_copy( $Entry, $target . '/' . $entry );
                continue;
            }
            copy( $Entry, $target . '/' . $entry );
        }

        $d->close();
    }else {
        copy( $source, $target );
    }
}

$source ='.';
$destination = '/html/parth/';
full_copy($source, $destination);
?>

I do not get anything in my parth folder. Why? I am using Windows, Script is executed on fedora system (its my server)...

© Stack Overflow or respective owner

Related posts about php

Related posts about copy