View Single Post
Old 2021-06-08, 14:13   #7
bsquared's Avatar
Feb 2007

1110011000002 Posts

Originally Posted by kruoli View Post
There might be a workaround for this. I'm interested in your opinion.

When starting YAFU, execute ecm and send it ^C programmatically and observe the resulting return code. Save it.

Another possibility would be to handle all return codes that are not defined by ecm itself (the manpage mentions only 0, 1, 2, 6, 8, 10 an 14) and are not handled otherwise as an abortion, because in this case, either the process was interrupted by the user or something else went horribly wrong.
I appreciate the ideas!

I'm not super keen on handling specific return codes (after my first failed attempt) because they are subject to change and I don't want to have to keep tabs on them.

Saving the return code on a test run seems like it could be the best way to go. However, yafu already does a lot of stuff on initialization so I have to pay attention to what gets added to it. If a use case involves running yafu in a loop, e.g. in a 'foreach', the init cost can start to add up significantly.

Building on that thought would be to add the return code test to the "tune" command. Then it could get saved in the .ini file or something.
bsquared is offline   Reply With Quote