Operating System - OpenVMS
1748102 Members
4937 Online
108758 Solutions
New Discussion юеВ

Re: How copy file form detached process?

 
SOLVED
Go to solution
├Еge R├╕nning
Trusted Contributor

Re: How copy file form detached process?

Antoniov,

I think the problem is that you do a RUN PROCESS and not a simple RUN IMAGE in the command procedure you give as input to LOGINOUT.EXE. So you create a detached process with a CLI which again create a new detached process without the CLI....

If you have a look at my example the input file did only a simple RUN DETACHED.EXE(or whatever your application is called). That means you probably have to get the input from other source than in your RUN command.... Either by pointing a logical to your input file or similar and open it from within the application.

Hope this helped?
VMS Forever
Antoniov.
Honored Contributor

Re: How copy file form detached process?

Age this is your example:
$! Create a command procedure that just has the RUN program command,
$! This procedure is the /INPUT for the RUN/DETACH command below.
$
$ create detach.com
$ RUN detach.exe
$!
$! Run loginout.exe as the image to create the detached process
$!
$ RUN/DETACH/ERROR=detach.err/OUTPUT=detach.out/INPUT=detach.com -
sys$system:loginout.exe
$!
=================================
Now this is my example:
$! This command procedure call another DCL command in detach mode
$ SET VERIFY
$ RUN/DETA/INP=detach.com/OUT=DETACH.LOG-
SYS$SYSTEM:LOGINOUT
$ SET NOVERIFY
$ EXIT
------ Here DETACH.COM
$ RUN/INP=myfile.txt/OUT=detach1.LOG -
DETACHED.EXE
$ EXIT
===================================
Is seems similar.
If type @DETACH.COM process DETACHED.EXE stay alive and works fine.
If I type @TMP that call DETACH.COM, process DETACHED can't alive after TMP is closed; it seems DETACHED can live only if TMP lives.

Any help will be apprecied.
Antoniov
Antonio Maria Vigliotti
├Еge R├╕nning
Trusted Contributor

Re: How copy file form detached process?

Antoniov,
it's one BIG difference and that is I only run the image called detach.exe while you do a RUN/INPUT etc. Your command will create a new detached process, mine will not. See help RUN IMAGE and RUN PROCESS to see difference.

I've attached a working example in Fortran(sorry, But havn't got one in C). If you got Fortran installed just download the attached file to your system and do a @file and it will create the files, run it and show the output file.
VMS Forever
Antoniov.
Honored Contributor

Re: How copy file form detached process?

Hi Age,
I've discovered the solution.
Process DETACH.COM have to stay alive to keep alive DETACHED.EXE. If I add a WAIT 00:01:00 before exit, DETACHED stay alive.
Solution is very complicated, but now I can't solve better.

Bye
Antoniov
Antonio Maria Vigliotti
Antoniov.
Honored Contributor

Re: How copy file form detached process?

Bunny rabbit!
Problem solved!
Detach process use SYS$CREPRC system service to create a new detached subprocess that calls SYS$SYSTEM:LOGINOUT.EXE with appropriate parameters.
If somebody need source can post here!

Age,
you get me idea for use LOGINOUT.
Post a message and I will assign you 8 pts!
Thanks

Antonio Maria Vigliotti
├Еge R├╕nning
Trusted Contributor
Solution

Re: How copy file form detached process?

Antoniov,
good to hear you solved your problem!
\Aage
VMS Forever