Page 1 of 1

Problem with XCopy

Posted: Wed Sep 13, 2006 7:29 pm
by winsonlee
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I try to copy all the files that i manage to find in to the temp directory but somehow it doesnt seems to be working.
Anyone here knows why ??

Code: Select all

<?php
// include class

include("Find.php");

// initialize finder
$finder = new File_Find();

// search for matching files 
// in named directory and subdirectories
$results = $finder->search("/pdf/i", "C:/Program Files/", "perl");




for ($i=0; $i<sizeof($results);$i++){
  echo $results[$i]."<BR>";

exec('xcopy '.$results[$i].' C:\\TEMP', $a, $a1);
  
}



?>

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Sep 13, 2006 7:53 pm
by s.dot
What errors are you getting?

Code: Select all

ini_set('display_errors','On');
error_reporting(E_ALL);

Posted: Wed Sep 13, 2006 8:09 pm
by winsonlee
There is no error in it.
Just that files is not copied to the new directory only

Posted: Wed Sep 13, 2006 8:34 pm
by feyd
Why on Earth are you trying to use xcopy when there's copy()?

Re: Problem with XCopy

Posted: Sat Dec 12, 2009 5:35 am
by deiremus
try using s switch on your shell command

exec('xcopy '.$results[$i].' C:\\TEMP /E', $a, $a1);

the switch will copy all the folders (even if its empty) and files and folders in it