Unit 'amigados' Package
[Overview][Constants][Types][Procedures and functions][Index] [#amunits]

SystemTagList

Have a shell execute a command line

Declaration

Source position: amigados.pas line 1728

function SystemTagList(

  const command: pCHAR;

  const tags: pTagItem

):LongInt;

function SystemTagList(

  const command: string;

  const tags: pTagItem

):LongInt;

Arguments

command

  

Program and arguments

tags

  

Tags for start (SYS_*) some (NP_*)

Arguments

command

  

Program and arguments

tags

  

Tags for start (SYS_*) some (NP_*)

Description

Similar to Execute(), but does not read commands from the input filehandle. Spawns a Shell process to execute the command, and returns the returncode the command produced, or -1 if the command could not be run for any reason. The input and output filehandles will not be closed by System, you must close them (if needed) after System returns, if you specified them via SYS_Input or SYS_Output.

By default the new process will use your current DosInput() and Output() filehandles. Normal Shell command-line parsing will be done including redirection on command. The current directory and path will be inherited from your process. Your path will be used to find the command (if no path is specified).

Note that you may NOT pass the same filehandle for both SYS_Input and SYS_Output. If you want input and output to both be to the same CON: window, pass a SYS_Input of a filehandle on the CON: window, and pass a SYS_Output of nil. The shell will automatically set the default Output() stream to the window you passed via SYS_Input, by opening '*' on that handler.

If used with the SYS_Asynch flag, it will close both it's input and output filehandles after running the command (even if these were your DosInput() and Output()!)

Normally uses the boot (ROM) shell, but other shells can be specified via SYS_UserShell and SYS_CustomShell. Normally, you should send things written by the user to the UserShell. The UserShell defaults to the same shell as the boot shell.

The tags are passed through to CreateNewProc() (tags that conflict with SystemTagList() will be filtered out). This allows setting things like priority, etc for the new process. The tags that are currently filtered out are:

See also

Execute

  

Execute a CLI command

CreateNewProc

  

Create a new process from taglist

DosInput

  

Identify the program's initial input file handle

DosOutput

  

Identify the programs' initial output file handle


Documentation generated on: 2021-07-30