This is all on XP. I am using CLI php to loop through a folder converting all .ppts to pdfs.
I use pdfcreator.exe for this. the relevant php line is:

$convertproc = proc_open('"C:\Program Files\PDFCreator\PDFCreator.exe" /NoStart /PF'.$file, $descriptorspec, $retval);

(I've also used exec() in earlier efforts).
I then get the process id using


and pause until the process is finished, then close the process:

while($procstatus['running']==1 )
$procstatus = proc_get_status($convertproc);

Then I try to rename the file:

$output = exec('ren '.$newfile .' '. $finalname, $output, $returnval);

However, the new pdf file seems to get written to *after* the process has finished running, so the rename fails. I've tried filesize(), is_readable(file) and all sorts of others but to no avail.

Any advice?