Wait for external program to complete

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Wait for external program to complete

sam-2
I have a small routine that need to call external .bat program and once its complete then I need to continue the rest of the step. It looks like it does not wait for external program complete. Can any one please help.

se := AbtProgramStarter new.
se programName: (CfsDirectoryDescriptor startUpDirectory,'\','dosometing.bat').
se programInput: param.
se startProgram.

..." I need to wait the above routine to be complete then the following to be start"

  filename := CwFileSelectionPrompter new title: 'Output'; 
defFilter:'*.*';prompt.
toFile := CfsWriteFileStream open: filename.
toFile isCfsError ifTrue: [ ^System prompt: toFile message ].

        I did use Delay command however it does not seems to be helpful for me.  
(Delay forMilliseconds: 5000) wait.

Even I did use Dos Wait command also in the .bat file. nothing seems to be working for me. 

Can some one please help me. Thanks

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/QmEBrTLRDIoJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Wait for external program to complete

Marten Feldtmann-2
At VastGoodies you may find a map named MSKPlatformExtension and within that map you find a class MSKProgramStarter and there are some Windows specific method like startProgramAndWaitForEnd ... which does what you want to do or at least gives you an ideas how to do it under Windows.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/25AsOaFEc4MJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.