<p><pre><code>    rc = libcox_exec_fmt(pHandle,&amp;pResult,&quot;ls &#x27;%s&#x27;&quot;,zDir); &#x2F;*Don&#x27;t forget the single quotes around &#x27;zDir&#x27; *&#x2F;
</code></pre>
This is either insecure, or so different from a shell as to make it not worth using shell syntax.<p>I really like the concept though. Took me to figure out what the concept is because &quot;system calls&quot; doesn&#x27;t mean &quot;shell commands&quot; to me, but having figured that out, operating on shell commands has a lot of things going for it.