stfc_boy
07-08-2010, 12:18 PM
Hello All,
Hoping someone can kindly help.
I'm looking to move any files from one directory (parsers) to another (complete). Now i've tried two ways
<?
/* Set the path details */
$path = '/home/*******/parsers/test/parse/'; //Directory which I read from
$complete = '/home/*******/parsers/test/complete/'; //Directory which I wish to place into
$dir = opendir($path);
while (false !== ($file = readdir($dir))) {
rename("$path/$file", "$complete/$file");
}
?>
But this way errors:
home/cfpdigi/*******/test/parse//.,/home/*******/parsers/test/complete//.) [function.rename]: Device or resource busy
and this way...
<?
/* Set the path details */
$path = '/home/*******/parsers/test/parse/'; //Directory which I read from
$complete = '/home/*******/parsers/test/complete/'; //Directory which I wish to place into
$dir = opendir($path);
rename("$path/$file", "$complete/$file");
?>
Moves file to 'complete' but then completely deletes the 'parse' folder, when I want the 'parse' folder to remain in place, but just have it's contents moved to 'complete'?
Anyone help?
Thanks
Hoping someone can kindly help.
I'm looking to move any files from one directory (parsers) to another (complete). Now i've tried two ways
<?
/* Set the path details */
$path = '/home/*******/parsers/test/parse/'; //Directory which I read from
$complete = '/home/*******/parsers/test/complete/'; //Directory which I wish to place into
$dir = opendir($path);
while (false !== ($file = readdir($dir))) {
rename("$path/$file", "$complete/$file");
}
?>
But this way errors:
home/cfpdigi/*******/test/parse//.,/home/*******/parsers/test/complete//.) [function.rename]: Device or resource busy
and this way...
<?
/* Set the path details */
$path = '/home/*******/parsers/test/parse/'; //Directory which I read from
$complete = '/home/*******/parsers/test/complete/'; //Directory which I wish to place into
$dir = opendir($path);
rename("$path/$file", "$complete/$file");
?>
Moves file to 'complete' but then completely deletes the 'parse' folder, when I want the 'parse' folder to remain in place, but just have it's contents moved to 'complete'?
Anyone help?
Thanks