Evening all,
I have a script below which reads files in a directory, when it’s done I wish for the file to be moved or copied to a new directory and removed from the current directory. Anyone help?
Thanks
<?
$path = '/home/*****/write/'; //Directory which I read from
$complete = '/home/*****/done/'; //Directory which I wish to place into
$dir = opendir($path);
while (false !== ($file = readdir($dir))) {
foreach ( $lines as $line ) {
//Process Code for inserting into database
}
//Now want to copy the file i've just processed from 'write' to 'done' AND delete from write DOES not seem to recognise $file?
copy($path.$file, $move.$file) or die("Unable to copy $path.$file to $move.$file");
}
?>