Home > lang > exec 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja ru zh zh_TW
Previous  Next  Edit  Rename  Undo  Refresh  Search  Administration  
Documentation
History
 
Warning! This page is not up to date.  See english version 
EXEC
[ Procezo = ] EXEC Komando [ WAIT ] [ FOR { { READ | INPUT } | { WRITE | OUTPUT } } ] [ AS Name ]
EXEC Komando TO Variablo

Plenumas komandon. Interna Process object estas kreata por managxi komandon.

Komando devas esi specifata tiel tablo de cxenoj enhavanto almenaux unu elemento. Unua elemento de tablo estas nomo de komando, kaj nekstoj estas malnepraj parametroj.

estas plenumata en fono.

Rimarku, ke vi bezonas referenco al Process object.

al gxin cxefeligo stream: evento Read estas altigata (???), kiam datumoj estas sendi al cxefeligo stream, kaj evento Error estas altigta (???) kiam datumoj estas sendi al cxeferarigo stream. Uzu porceso object kun Stream & Input/Output functions por legi cxefoeligon de proceso:.

Se vi uzas INPUT and OUTPUT sxlosilvorto anstataux READ kaj WRITE, tiam proceso estas plenumata anstataux virtualan terminalon. Oni signifas ke proceso pensas lancxi interne veran terminalon.

Nomo estas nomo de evento estas uzata de Process object. Defulto, gxi estas "Proceso".

Vi povas akiri referenco al interna Process object kreata de uzanto valorizo.

Se vi uzas dua sintakso, komando estas plenumata, interpretero atendanta por gxia fino, kaj tuta komando eligo estas meti en specifata cxeno.

Example

' Get the contents of a directory
EXEC [ "ls", "-la", "/tmp" ] WAIT

' Get the contents of a directory into a string
DIM sOutput AS String
EXEC [ "ls", "-la", "/tmp" ] TO sOutput

' Get the contents of a directory into a string, but in background

DIM sOutput AS String

' A specific event name is used
EXEC [ "ls", "-la", "/tmp" ] FOR READ AS "Contents"

...

PUBLIC SUB Contents_Read()

  DIM sLine AS String

  READ #LAST, sLine, -256

  sOutput &= sLine

END

PUBLIC SUB Contents_Kill()

  PRINT sOutput

END

Se vi volas scii kiel vi povas legi multajn bitojn en Process_Read eventa traktilo, uzu funkcion Lof.

Kiel argumento estas sendi rekte gxis proceso, vi ne havas citi gxin, kiel vi devas fari en sxelo.

' perl -e 'print while <>;' becomes

EXEC [ "perl", "-e", "print while <>;" ] FOR READ WRITE

See also

Process Management, Process, Lof