doyle007
asked on
Conditional Wait Time - PHP
Currently I have the following piece of code:
**************
exec("C:\MQInjector\MQexec uteBat.exe ") or die("Error when running MQ Client");
usleep(2000000);
$fileread="C:\MQInjector\C hgPwd1.out ";
$chgpwdo=fopen($fileread, "r") or die("Error - MQ Client did not complete run");
$read=fread($chgpwdo, filesize($fileread));
fclose($chgpwdo);
*************
The exec statement creates the ChgPwd1.out file, therefore I have put the 2second wait in there to ensure the file is created. However, this is probably not the best way to do it.
Is it possible to structure this to ensure the file is created and current (Note that the exec command may also over-write an existing copy of the ChgPwd1.out file)?
**************
exec("C:\MQInjector\MQexec
usleep(2000000);
$fileread="C:\MQInjector\C
$chgpwdo=fopen($fileread, "r") or die("Error - MQ Client did not complete run");
$read=fread($chgpwdo, filesize($fileread));
fclose($chgpwdo);
*************
The exec statement creates the ChgPwd1.out file, therefore I have put the 2second wait in there to ensure the file is created. However, this is probably not the best way to do it.
Is it possible to structure this to ensure the file is created and current (Note that the exec command may also over-write an existing copy of the ChgPwd1.out file)?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.