home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / amiga / programm / 11564 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  1.7 KB

  1. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!eb15+
  2. From: eb15+@andrew.cmu.edu (Edward D. Berger)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Using System() when started from Workbench -- path?
  5. Message-ID: <0ePirjO00WB6AL40NI@andrew.cmu.edu>
  6. Date: 23 Jul 92 09:35:43 GMT
  7. Article-I.D.: andrew.0ePirjO00WB6AL40NI
  8. Organization: Pittsburgh Supercomputing Center, Carnegie Mellon, Pittsburgh, PA
  9. Lines: 35
  10.  
  11. I'm interested in using the System() function in my program, so I started
  12. to play again with AmigaMail example from the Fish Disks.  I will be using
  13. the Asynchronous beginCommand(), so I chopped out the other code, and changed
  14. the two examples launched to "path" and "newshell".
  15.  
  16. This works great from a Shell, but when I run the program from Workbench,
  17. the only available path is:
  18.   Current_Directory
  19.   C:
  20.  
  21. Does someone have a simple example of getting the path from the Workbench
  22. process so I can feed it to System()?  I presume I will have to do something
  23. like this:
  24.  
  25.     Forbid();
  26.     printf("Trying to find workbench!\n");
  27.     wb_task = FindTask("Workbench");
  28.     if( !wb_task )
  29.         printf(" Couldn't find Workbench!\n");
  30.     else{
  31.         printf(" Found the Workbench Task!\n");
  32.         /* Allocate memory for a (BPTR)cli_CommandDir */
  33.         /* Somehow make a copy of that from Workbench */
  34.         }
  35.     Permit();
  36.  
  37. I am using SAS/C 5.10a with the V37.4 includes from NATDEV20.
  38. If possible the code should be portable to DICE.  The code may use
  39. V37 calls, as it is a 2.04 only application.
  40.  
  41. Thanks in advance.
  42.  
  43. -Ed Berger
  44. eb15@andrew.cmu.edu
  45. eberger@psc.edu
  46.