Time limit on .exe file execution

5 次查看(过去 30 天)
Peter
Peter 2023-6-25
I have a function that executes an exe file and enters a txt file of inputs after the file executes. This function is called in a loop by another script. Occasionally, the exe file will get hung and will not terminate on its own. Is there a way for me to implement a time limit on the exe before killing the process?
this is how I currently execute the file, before I discovered the error.
cmd = 'program.exe < program_input.txt';
[status,result] = system(cmd);

回答(1 个)

Jacob Mathew
Jacob Mathew 2023-6-25
Hi Peter,
This will allow you to set up a timeout condition

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

标签

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by