a1200   NEWS   APPS   DOCS   ABOUT
a1200
----
a1200
----
Autodocs
 Libraries:
 dos.library
  AbortPkt
  AddBuffers
  AddDosEntry
  AddPart
  AddSegment
  AllocDosObject
  AssignAdd
  AssignLate
  AssignLock
  AssignPath
  AttemptLockDosList
  ChangeMode
  CheckSignal
  Cli
  CliInitNewcli
  CliInitRun
  Close
  CompareDates
  CreateDir
  CreateNewProc
  CreateProc
  CurrentDir
  DateStamp
  DateToStr
  Delay
  DeleteFile
  DeleteVar
  DeviceProc
  DoPkt
  DupLock
  DupLockFromFH
  EndNotify
  ErrorReport
  ExAll
  ExAllEnd
  ExNext
  Examine
  ExamineFH
  Execute
  Exit
  FGetC
  FGets
  FPutC
  FPuts
  FRead
  FWrite
  Fault
  FilePart
  FindArg
  FindCliProc
  FindDosEntry
  FindSegment
  FindVar
  Flush
  Format
  FreeArgs
  FreeDeviceProc
  FreeDosEntry
  FreeDosObject
  GetArgStr
  GetConsoleTask
  GetCurrentDirName
  GetDeviceProc
  GetFileSysTask
  GetProgramDir
  GetProgramName
  GetPrompt
  GetVar
  Info
  Inhibit
  Input
  InternalLoadSeg
  InternalUnLoadSeg
  IoErr
  IsFileSystem
  IsInteractive
  LoadSeg
  Lock
  LockDosList
  LockRecord
  LockRecords
  MakeDosEntry
  MakeLink
  MatchEnd
  MatchFirst
  MatchNext
  MatchPattern
  MatchPatternNoCase
  MaxCli
  NameFromFH
  NameFromLock
  NewLoadSeg
  NextDosEntry
  Open
  OpenFromLock
  Output
  ParentDir
  ParentOfFH
  ParsePattern
  ParsePatternNoCase
  PathPart
  PrintFault
  PutStr
  Read
  ReadArgs
  ReadItem
  ReadLink
  Relabel
  RemAssignList
  RemDosEntry
  RemSegment
  Rename
  ReplyPkt
  RunCommand
  SameDevice
  SameLock
  Seek
  SelectInput
  SelectOutput
  SendPkt
  SetArgStr
  SetComment
  SetConsoleTask
  SetCurrentDirName
  SetFileDate
  SetFileSize
  SetFileSysTask
  SetIoErr
  SetMode
  SetOwner
  SetProgramDir
  SetProgramName
  SetPrompt
  SetProtection
  SetVBuf
  SetVar
  SplitName
  StartNotify
  StrToDate
  StrToLong
  SystemTagList
  UnGetC
  UnLoadSeg
  UnLock
  UnLockDosList
  UnLockRecord
  UnLockRecords
  VFPrintf
  VFWritef
  VPrintf
  WaitForChar
  WaitPkt
  Write
  WriteChars
Include
GuruMeditation
Docs » Autodocs » dos.library » Execute

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

RESULT

	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

Comments

Name:
E-mail: Use this if you want a message if you get a response, will not be shown.
Comment:
Select correct short for:

Abyss

CSL
SPB
AYS
TRSI

Comments:

$VER: d0.se 1.14 Copyright © 2011-2024 Tobias Geijersson support at d0 dot se