In response to Matthew's answer, do not create a shell process if you do not need it. If you use the fork / execl combination, the individual parameters will never be parsed, so they should not be avoided. Beware of null characters, however this will terminate the parameter prematurely (in some cases this is not a security issue).
I assume mkdir is just an example, since mkdir can be trivially called from C ++ much easier than these subprocess sentences.
Markr source share