home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / msdos / programm / 8017 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  2.5 KB

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!mips!mips!munnari.oz.au!yoyo.aarnet.edu.au!dstos3.dsto.gov.au!roo
  2. From: roo@dstos3.dsto.gov.au
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: redir output of child in MS-FORTRAN ?
  5. Message-ID: <1992Jul23.100006.164260@dstos3.dsto.gov.au>
  6. Date: 23 Jul 92 16:00:05 GMT
  7. Organization: Defence Science and Technology Organisation
  8. Lines: 48
  9.  
  10.  
  11. I have a program written in MS-FORTRAN which runs another program as a child and
  12. needs to redirect the screen output of the child --- currently to NUL, but it is
  13. envisaged allowing to a file.
  14.  
  15. I am doing this via
  16.  
  17.      I = SYSTEM('prog > NUL'C)
  18.  
  19. which is the documented in the MS-FORTRAN ``Advanced Topics'' and uses the
  20. MS-C system call.
  21.  
  22. Now, the program I am running as a child uses a large amount of memory (about
  23. 400K), so I have used the SPAWNO replacement for the system call (speaking as a
  24. satisfied user, that's a great package BTW).
  25.  
  26. Now, because of the size of the child, I would prefer to be even more miserly
  27. with memory, and do without losing even the 3K or so which COMMAND.COM takes up
  28. because of the system call. So I would prefer to do something along the lines of
  29.  
  30.       CALL redirect_output(file_or_device)
  31.       I = spawnlpe(args)
  32.  
  33.  
  34. To make things more difficult, I do not have a MS-C compiler handy (for wierd
  35. and wonderful admin reasons we use Turbo/Borland C and MS-FORTRAN around here),
  36. so I can't use solutions which have been given in a similar thread recently on
  37. redirecting input and output, unless there is a good way to access Turbo C from
  38. MS-FORTRAN.
  39.  
  40. Any advice/pointers/RTFM's will be much appreciated.
  41.  
  42. ----------------
  43. Robert O'Dowd                              Phone  : +61 8 259 7132
  44. Bldg. 64 TSAN,  AS/MOD                     Fax    : +61 8 259 6104
  45. P.O. Box 1700                              E-mail : roo@dstos3.dsto.oz.au
  46. DSTO Salisbury, South Australia               OR    roo@dstos3.dsto.gov.au
  47.                                               OR    roo@mod.dsto.gov.au
  48. Std Disclaimer: Opinions above are MINE, probably worth what you paid for them.
  49.  
  50. -- 
  51. ----------------
  52. Robert O'Dowd                              Phone  : +61 8 259 7132
  53. Bldg. 64 TSAN,  AS/MOD                     Fax    : +61 8 259 6104
  54. P.O. Box 1700                              E-mail : roo@dstos3.dsto.oz.au
  55. DSTO Salisbury, South Australia               OR    roo@dstos3.dsto.gov.au
  56.                                               OR    roo@mod.dsto.gov.au
  57. Disclaimer: Opinions above are MINE, and probably worth what you paid for them.
  58.