J
James Kanze
On 02/18/11 05:00 PM, Adrian wrote:
What the system() function returns is implementation defined. You'll
have to check your system documentation.
Maybe. But both Unix and Windows return the exit code of the
child process, and in both cases, 0 means success (and in both
cases, there are programs which return random exit codes).
The real portability problem is what to put in the string you
pass to system. "ls -lt" will have decidedly different results
on a Unix machine than under Windows (unless you've installed
CygWin and have it in your path). And more complicated commands
may work differently on different flavors of Unix, even without
taking Windows into consideration. Or they may work differently
depending which packages you have installed under Linux, even
without taking different flavors of Windows into consideration.