Simulate xcopy functions. Simulate xcopy functions? Php ************************************ system name: simulate xcopy function * program function: simulate xcopy function * development date: 20030314 ************* simulate xcopy function /*************************************
* System name: simulate xcopy function
* Program function: simulates xcopy functions.
* Development date: 2003/03/14
*************************************/
?>
// Copy a ction's all files to another direction
Function xCopy ($ source, $ destination, $ child ){
// Usage:
// XCopy ("feiy", "feiy2", 1): copy the file under feiy to feiy2, including subdirectories
// XCopy ("feiy", "feiy2", 0): copy the file under feiy to feiy2, excluding subdirectories.
// Parameter description:
// $ Source: source directory name
// $ Destination: name of the target Directory
// $ Child: indicates whether the subdirectory is included during replication.
If (! Is_dir ($ source )){
Echo ("Error: the $ source is not a direction! ");
Return 0;
}
If (! Is_dir ($ destination )){
Mkdir ($ destination, 0777 );
}
$ Handle = dir ($ source );
While ($ entry = $ handle-> read ()){
If ($ entry! = ".") & ($ Entry! = "..")){
If (is_dir ($ source. "/". $ entry )){
If ($ child)
XCopy ($ source. "/". $ entry, $ destination. "/". $ entry, $ child );
}
Else {
Copy ($ source. "/". $ entry, $ destination. "/". $ entry );
}
}
}
Return 1;
}
?>
Why? Php /************************************** system name: simulate xcopy function * program function: simulate xcopy function * development date: 2003/03/14 ************...