run procedure extern

nicolas

Member
Hello
I am running a process from php progress from php using exec.

script.php -> Exec(ruta/progress.exe parámetros ruta/file.r)

The process progress file.r run a second process:

File.r -> Run ruta/file2.r(input, output).

The end file2.r process writes a log file, I direct and close file command (output close) does not complete, ie, it stays there, does not end file2.r therefore file.r php script and also freezes .
I kill the process in Windows prowin32.exe to finish, the funny thing is that the log file is created in file2.r deleted.
Why is the second process is frozen? Any ideas?
 

D.Cook

Member
Hard to say. Are you able to pinpoint the exact point where the program freezes? Perhaps add a few message statements and see where it stops.
 

nicolas

Member
if. processed whole file2.ry eventually freezes here:

OUTPUT TO VALUE(file1) .
{all process}
output close.


TempError = LENGTH(File2, "CHARACTER") NO-ERROR.
IF TempError > 1 THEN DO:


OUTPUT TO file2.
PUT UNFORMATTED STRING(wError).
OUTPUT CLOSE. (freezes here)
END.


but it only happens when I run from file.r, if I run it directly no problem
 

RealHeavyDude

Well-Known Member
You do not run your file2.p from file.p persistent? Just wondering because you do not reveal the code in file.p that contains the RUN statement.

Heavy Regards, RealHeavyDude.
 

nicolas

Member
file.p



DEFINE VARIABLE ....


sCad = SESSION:pARAMETER.
sCad = string(BASE64-DECODE ( TRIM(sCadena) )).


RUN ruta\file2.r (INPUT var1, OUTPUT vError).
 

D.Cook

Member
To avoid confusion it would be a good idea to use different named streams for each output destination. Eg:
Code:
define stream log_strm.
define stream error_strm.

output stream log_strm to value(file1).
{processing}
output stream log_strm close.

etc..
 

RealHeavyDude

Well-Known Member
Just a few other things ...

How do you call the file.p from PHP - do you use the -b (batch) option?

Do you have a development license installed on the system where you test this - the standard behavior of non-batch sessions is that you end up in the procedure editor when a development license is installed on the machine. In any case it might be a good idea to put a QUIT statement at the end of your file.p to really quit the session.

Heavy Regards, RealHeavyDude.
 
Top