0

I run a simple php code on windows machine: exec('b.exe b.txt c.txt').

b.txt is the input and c.txt is the output.

sometimes the output txt file(c.txt) is very big and i need to prevent it by killing the process. I think i must check the size of output and if is bigger than 10 MB i must kill the exec. Any idea about how i could kill the exec;

1 Answers1

0

Use this to execute the command asynchronously. Use a while loop with a moderate sleep timer, and continually check the size of the c.txt file, and if the process is still alive. Use this to kill the process if it's too big.

Blue
  • 22,608
  • 7
  • 62
  • 92