Starting another Programm from C
  • Just looking around
    MacMini
    Posts: 8 from 2016/10/17
    From: Germany
    Hi everyone.

    Currently I'm trying to Programm a little Wrapper for UAE to start WHDLoad slaves.

    My current problem is that i don't know how to start another programm out of my sources. Is it still possible using the System command like under Windows or Linux?

    Regards
    Current Systems:
    Ibook G4 registered
    MacMini G4 registered
    Powermac G5 9,1 hopefully soon supported
  • »19.10.16 - 15:52
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    Code:
        NAME Execute -- Execute a CLI command     SYNOPSIS success = Execute( commandString, input, output ) D0 D1 D2 D3 BOOL Execute(STRPTR, BPTR, BPTR)     FUNCTION This function attempts to execute the string commandString as a Shell command and arguments. The string can contain any valid input that you could type directly in a Shell, including input and output redirection using < and >. Note that Execute() doesn't return until the command(s) in commandstring have returned. The input file handle will normally be zero, and in this case Execute() will perform whatever was requested in the commandString and then return. If the input file handle is nonzero then after the (possibly empty) commandString is performed subsequent input is read from the specified input file handle until end of that file is reached. In most cases the output file handle must be provided, and is used by the Shell commands as their output stream unless output redirection was specified. If the output file handle is set to zero then the current window, normally specified as *, is used. Note that programs running under the Workbench do not normally have a current window. Execute() may also be used to create a new interactive Shell process just like those created with the NewShell command. In order to do this you would call Execute() with an empty commandString, and pass a file handle relating to a new window as the input file handle. The output file handle would be set to zero. The Shell will read commands from the new window, and will use the same window for output. This new Shell window can only be terminated by using the EndCLI command. Under V37, if an input filehandle is passed, and it's either interactive or a NIL: filehandle, the pr_ConsoleTask of the new process will be set to that filehandle's process (the same applies to SystemTagList()). For this command to work the program Run must be present in C: in versions before V36 (except that in 1.3.2 and any later 1.3 versions, the system first checks the resident list for Run).     INPUTS commandString - pointer to a null-terminated string input - BCPL pointer to a file handle output - BCPL pointer to a file handle     RESULTS success - BOOLEAN indicating whether Execute was successful in finding and starting the specified program. Note this is NOT the return code of the command(s).     SEE ALSO SystemTagList(), NewShell, EndCLI, Run 


    #include <proto/exec.h>
    #include <proto/dos.h>
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »19.10.16 - 16:36
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    No idea what's wrong with the carriage returns in my previous post.

    See here for same info:

    http://amigadev.elowar.com/read/ADCD_2.1/Includes_and_Autodocs_3._guide/node015E.html
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »19.10.16 - 17:21
    Profile
  • Just looking around
    MacMini
    Posts: 8 from 2016/10/17
    From: Germany
    Thanks alot. This helps me alot.

    Is somewhere a refernce guide avaiable for download???

    Regards
    Current Systems:
    Ibook G4 registered
    MacMini G4 registered
    Powermac G5 9,1 hopefully soon supported
  • »19.10.16 - 17:49
    Profile
  • MorphOS Developer
    geit
    Posts: 1034 from 2004/9/23
    You can use SDK:docs within the MorphOS SDK or if you prefer stuff online: http://amigadev.elowar.com/
  • »19.10.16 - 18:07
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    Quote:

    MacMini wrote:
    Thanks alot. This helps me alot.

    Is somewhere a refernce guide avaiable for download???

    Regards


    The root of the site I previously linked is good and searchable.

    Also there are loads of PDF scans here:

    http://www.bombjack.org/commodore/amiga-books.htm

    Here: http://bombjack.org/commodore/amiga/books/abacus.htm

    And here: http://amiga-manuals.xiik.net/amiga.php

    [ Edited by Intuition 19.10.2016 - 20:36 ]
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »19.10.16 - 18:33
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    asrael22
    Posts: 404 from 2014/6/11
    From: Germany
    Quote:

    MacMini wrote:
    Hi everyone.

    Currently I'm trying to Programm a little Wrapper for UAE to start WHDLoad slaves.

    My current problem is that i don't know how to start another programm out of my sources. Is it still possible using the System command like under Windows or Linux?

    Regards


    Why a C program?
    Wouldn't a shell script suffice?


    Manfred
  • »19.10.16 - 21:05
    Profile
  • Just looking around
    MacMini
    Posts: 8 from 2016/10/17
    From: Germany
    Right now I'm a professional Java-Dev and want to learn another language. And of cource a less complex C-Program can be the start of more complex projects in the future.

    Development is not just my job. It is more like my hobby.
    Current Systems:
    Ibook G4 registered
    MacMini G4 registered
    Powermac G5 9,1 hopefully soon supported
  • »20.10.16 - 07:07
    Profile