Path: utzoo!attcan!uunet!portal!cup.portal.com!Don_A_Corbitt From: Don_A_Corbitt@cup.portal.com Newsgroups: comp.lang.c Subject: Re: turbo c question (ibm pc clone) Message-ID: <11314@cup.portal.com> Date: 14 Nov 88 15:57:48 GMT References: <806@starfish.Convergent.COM> Distribution: na Organization: The Portal System (TM) Lines: 24 >I've been trying to use the 'system()' function call in my turbo c > >main() >{ > int a; > > a = system("dir a:"); > > if (!(a)) > printf("\nSystem call successful"); > else > printf("\nsystem call error"); >} >(When running it within tc2.0, the system() call never really seems to >happen, but a does get set to zero, indicating a successful call! The >System call successful message prints). >Jerry. (jerry@starfish.convergent.COM) Sounds like your problem is insufficient memory. There is a bug in TC2.0 where the system() call doesn't return an error if insufficient memory to load command.com. The work-around is to check errno after the call to system. Errno is set properly. (Be sure to set errno=0; before calling system().) Don_A_Corbitt@cup.portal.com CrystalGraphics, Inc. -----