home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20069 < prev    next >
Encoding:
Text File  |  1993-01-22  |  989 b   |  30 lines

  1. Path: sparky!uunet!cs.utexas.edu!uwm.edu!rutgers!mcdhup!src4src!wozzle!alane
  2. From: alane@wozzle.linet.org (J. Alan Eldridge)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help with spawnl() function
  5. Message-ID: <TskPXB3w165w@wozzle.linet.org>
  6. Date: 21 Jan 93 03:56:28 GMT
  7. References: <yT7JXB3w164w@jaflrn.UUCP>
  8. Organization: Disorganization
  9. Lines: 19
  10.  
  11. jaf@jaflrn.UUCP (Jon Freivald) writes:
  12.  
  13. > Why not use remove() or unlink()?  You can't do "system("del file")
  14. > because del (& erase) are internal commands, although you could do
  15. > "system("command /c del file")" [a consideration here - what about folks
  16. > who don't use command.com?  It's no-where on my machine, and which
  17. > command processor I'm using depends on what mood I'm in..!]
  18.  
  19. char szCmdbuf[ 130 ];
  20. char *szComspec=getenv("COMSPEC");
  21.  
  22. if (!szComspec)
  23.     szComspec="COMMAND.COM";
  24. sprintf(szCmdbuf, "%s /C del file", szComspec);
  25. system(szCmdbuf);
  26.  
  27.  
  28. alane@wozzle.linet.org (J. Alan Eldridge)
  29. Fido: The University of Walamaloo 1:272/38.473
  30.