47 points · by symisc_devel · 11y ago · 27 comments
libcox is for when your existing code would do something like system("uname") or system("ls") (... except not even with system(), with popen() or something), and you want it portable to Windows.
So if you ask this question, you might as well ask why system calls are not more expansive in their capabilities.
I think there's a reason, system calls are much simpler. They are building bricks. If you want to layer something complex on top, you're free to do so.
About your suggestions, ACE's documentation is particularly bad. I wouldn't recommend it to anyone.
Thanks also to you for sharing a couple well-established alternatives.
rc = libcox_exec_fmt(pHandle,&pResult,"ls '%s'",zDir); /*Don't forget the single quotes around 'zDir' */
This is either insecure, or so different from a shell as to make it not worth using shell syntax.I really like the concept though. Took me to figure out what the concept is because "system calls" doesn't mean "shell commands" to me, but having figured that out, operating on shell commands has a lot of things going for it.