home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / apple2 / 25746 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.3 KB  |  44 lines

  1. Newsgroups: comp.sys.apple2
  2. Path: sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!hphalle6!behrenss
  3. From: behrenss@Informatik.TU-Muenchen.DE (Soenke Behrens)
  4. Subject: ORCA system() command ... help!
  5. Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
  6. Organization: Technische Universitaet Muenchen, Germany
  7. Date: Fri, 18 Dec 1992 15:48:26 GMT
  8. Message-ID: <behrenss.724693706@hphalle6>
  9. Lines: 33
  10.  
  11. Hail,
  12.  
  13. please, someone help me. The following code produces (after executing
  14. the system() call) an error message "Could not find file:" from the
  15. system. Very strange. 
  16.  
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <strlib.h>
  20.  
  21. int
  22. main (void)
  23. {
  24.   int result;
  25.   char *it;
  26.  
  27.   it = strdup ("compile -E -P test.c  keep=test");
  28.   result = system (it);
  29.   return (result);
  30. }
  31.  
  32. test.c does of course exist, strdup duplicates a string (and allocates
  33. space for it via malloc). The same code w/o the strdup works (i.e. if
  34. I chant 'result = system ("compile -E -P test.c  keep=test");').
  35. Very, very strange ....
  36.  
  37. Soenke
  38.  
  39. -- 
  40. ===========================================================================
  41. More than silver, more than gold, I need   !    behrenss@informatik.
  42. electricity. I need it for my dreams.      !    tu-muenchen.de
  43. (RACTER)                                   !  FIDO: 2:246/13 Soenke Behrens
  44.