Xref: utzoo comp.sys.ibm.pc:23847 comp.lang.c:15842 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!nrl-cmf!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!stc!datlog!scm From: scm@datlog.co.uk ( Steve Mawer ) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: Re: system() always returns 0? Keywords: MSC5.0 Message-ID: <1728@dlvax2.datlog.co.uk> Date: 26 Jan 89 12:22:42 GMT References: <782@hawkmoon.MN.ORG> Reply-To: scm@datlog.co.uk ( Steve Mawer ) Organization: Data Logic Ltd, Queens House, Greenhill Way, Harrow, London. Lines: 24 In article <782@hawkmoon.MN.ORG> det@hawkmoon.MN.ORG (Derek E. Terveer) writes: >Has anyone encountered a problem with the Microsoft C 5.0 compiler always >returning a 0 from the system() call, no matter what the actual command >executed by system() returns? > >and i'm having a hard time of it since system() always (seems) to return 0! > According to my Microsoft manual "The system function returns the value 0 if string is successfully executed. A return value of -1 indicates an error ..." and cites the error reasons as being E2BIG - arg list > 128 bytes or env info >32K ENOENT - can't find COMMAND.COM ENOEXEC - COMMAND.COM file can't be executed ENOMEM - insufficient memory to execute the command, etc. What it returns is whether its exec succeeded, not the exec'd command's status. I have been burned by this problem, too, and haven't got a solution. (Anyone?) -- Steve C. Mawer or < {backbone}!ukc!datlog!scm > Voice: +44 1 863 0383 (x2153)