shell calls
Moderators: Susan Smith, admin, Gabriel
shell calls
what is the right way to disable timeout on an individual shell call? (to avoid the 4591) with out setting shell limit in the brconfig.sys?
I tried SY -t0 but that made it timeout immediately.
-john
I tried SY -t0 but that made it timeout immediately.
-john
Instead of calling your program directly, call a batch file.
Your batch file should call the program you want, then create an output file indicating that its done.
Your BR program should call the batch file with the -C parameter, so that it doesn't wait at all and also doesn't give an error. Right after calling the batch file, you loop, waiting until the "done indicator" file appears telling you its done.
This is just an idea, I'm just brainstorming here, I haven't tried it. It seems like it would work but it may not. It would be nice if there is a parameter we're just not aware of to make the System call not ever timeout. (have you tried -1)?
Gabriel
Your batch file should call the program you want, then create an output file indicating that its done.
Your BR program should call the batch file with the -C parameter, so that it doesn't wait at all and also doesn't give an error. Right after calling the batch file, you loop, waiting until the "done indicator" file appears telling you its done.
This is just an idea, I'm just brainstorming here, I haven't tried it. It seems like it would work but it may not. It would be nice if there is a parameter we're just not aware of to make the System call not ever timeout. (have you tried -1)?
Gabriel
-
- Posts: 4
- Joined: Mon Jun 08, 2009 9:58 pm
John, your batch file (with a .bat extension) can be as simple as:
path\file.exe (Whatever your called program is)
echo >testdone (or whatever file name you would test for)
In your BR program, while looping to check for file "testdone" add a SLEEP(n) to pause it for n seconds so it doesn't chew up processor time in a hard loop. Also need to delete file "testdone" in the BR program after waiting for it.
path\file.exe (Whatever your called program is)
echo >testdone (or whatever file name you would test for)
In your BR program, while looping to check for file "testdone" add a SLEEP(n) to pause it for n seconds so it doesn't chew up processor time in a hard loop. Also need to delete file "testdone" in the BR program after waiting for it.
Taken from the BR_CS.TXT file in Dll_Distr/DOC:
The -t is mentioned as an exception to the "no limit" setting.
Please note that the -1 refers to the SHELL LIMIT statement, not the -t parameter.SHELL LIMIT 9999
Sets default timeout - maximum seconds to wait for a child process.
If not specified, this value is set to 240 seconds. Minus one ( -1 )
indicates never timeout unless -t is specified in the System command.
The -t is mentioned as an exception to the "no limit" setting.
-
- Posts: 291
- Joined: Fri Jun 19, 2009 9:01 am
- Location: Lawrence, Kansas
- Contact:
Gabe and John you already answered your own question...
-C gives you a shell call without any timeout so there is no need for a parameter on the -t flag.
If your needing BR to know when you exited the shell. You have to setup a trigger like Gabe mentioned of something to look for in BR when the shell completes, that can be a file or an ENV$ variable changed or another of different triggers. Since we created our own EXE's that we call outside BR we built in a stshell.tmp file that is set to read only and BR watches until it can successfully write to stshell.tmp without a 4205 error. In our EXE it locks stshell.tmp when it first executes and unlocks it when it exits. Thus the 4205 error when BR attempts to write to it.
-C gives you a shell call without any timeout so there is no need for a parameter on the -t flag.
If your needing BR to know when you exited the shell. You have to setup a trigger like Gabe mentioned of something to look for in BR when the shell completes, that can be a file or an ENV$ variable changed or another of different triggers. Since we created our own EXE's that we call outside BR we built in a stshell.tmp file that is set to read only and BR watches until it can successfully write to stshell.tmp without a 4205 error. In our EXE it locks stshell.tmp when it first executes and unlocks it when it exits. Thus the 4205 error when BR attempts to write to it.
Steve Koger
Computer Specialist
SEKESC-MACS Division
Computer Specialist
SEKESC-MACS Division