home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.apple2
- Path: sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!hphalle6!behrenss
- From: behrenss@Informatik.TU-Muenchen.DE (Soenke Behrens)
- Subject: ORCA system() command ... help!
- Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
- Organization: Technische Universitaet Muenchen, Germany
- Date: Fri, 18 Dec 1992 15:48:26 GMT
- Message-ID: <behrenss.724693706@hphalle6>
- Lines: 33
-
- Hail,
-
- please, someone help me. The following code produces (after executing
- the system() call) an error message "Could not find file:" from the
- system. Very strange.
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <strlib.h>
-
- int
- main (void)
- {
- int result;
- char *it;
-
- it = strdup ("compile -E -P test.c keep=test");
- result = system (it);
- return (result);
- }
-
- test.c does of course exist, strdup duplicates a string (and allocates
- space for it via malloc). The same code w/o the strdup works (i.e. if
- I chant 'result = system ("compile -E -P test.c keep=test");').
- Very, very strange ....
-
- Soenke
-
- --
- ===========================================================================
- More than silver, more than gold, I need ! behrenss@informatik.
- electricity. I need it for my dreams. ! tu-muenchen.de
- (RACTER) ! FIDO: 2:246/13 Soenke Behrens
-