I use system() for executing a shell command in Swift. As read in the documentation return value should be 0, if successful or -1 if it failed. But I get 256 and execution seems to be successful.
There are some other questions related to magical value "256" but with different languages and no solutions/explanations.
I would add a comparison to 256 for success, but it would be better to know what happened and what else should be checked for success.
Added: Yes, I read this. And there are a lot of assumptions and guesses, but no explicit solution. And it is not Swift.