home *** CD-ROM | disk | FTP | other *** search
- 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+
- From: eb15+@andrew.cmu.edu (Edward D. Berger)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Using System() when started from Workbench -- path?
- Message-ID: <0ePirjO00WB6AL40NI@andrew.cmu.edu>
- Date: 23 Jul 92 09:35:43 GMT
- Article-I.D.: andrew.0ePirjO00WB6AL40NI
- Organization: Pittsburgh Supercomputing Center, Carnegie Mellon, Pittsburgh, PA
- Lines: 35
-
- I'm interested in using the System() function in my program, so I started
- to play again with AmigaMail example from the Fish Disks. I will be using
- the Asynchronous beginCommand(), so I chopped out the other code, and changed
- the two examples launched to "path" and "newshell".
-
- This works great from a Shell, but when I run the program from Workbench,
- the only available path is:
- Current_Directory
- C:
-
- Does someone have a simple example of getting the path from the Workbench
- process so I can feed it to System()? I presume I will have to do something
- like this:
-
- Forbid();
- printf("Trying to find workbench!\n");
- wb_task = FindTask("Workbench");
- if( !wb_task )
- printf(" Couldn't find Workbench!\n");
- else{
- printf(" Found the Workbench Task!\n");
- /* Allocate memory for a (BPTR)cli_CommandDir */
- /* Somehow make a copy of that from Workbench */
- }
- Permit();
-
- I am using SAS/C 5.10a with the V37.4 includes from NATDEV20.
- If possible the code should be portable to DICE. The code may use
- V37 calls, as it is a 2.04 only application.
-
- Thanks in advance.
-
- -Ed Berger
- eb15@andrew.cmu.edu
- eberger@psc.edu
-