VARKON Version 1.15 1997-10-24


os - Procedure

Operating system command


Description

Sends a command to the operating system.

Syntax

os(command, mode)

STRING command*132;
INT mode;


Principal parameters

command - The operating system command


Optional parameters

mode - 0 = Wait for command to finish, default
   1 = Run command in separate window
   2 = Do not wait for command to finish


UNIX-Examples

os("grep pattern files >file.txt");

Searches files for pattern and writes the result to file.txt.

os("vi textfile", 1);

Creates a new window and starts a texteditor.

os("postscript <plotfile.PLT | lp", 2);

Sends a plot to a poscript printer and continues execution without waiting for the plot to finish.

Windows95/NT-Examples

os("COMMAND.COM /C DIR >dirfile.txt");

Executes the DIR-command in DOS and sends the output to a file. No DOS-window is created.

os("program.exe",1);

A program is started and the result displayed in a DOS-window.

Comments

The UNIX-version of VARKON passes the command string to the shell through the system()-routine.

In Windows95/NT VARKON sends the command to the CreateProcess() routine.


VARKON Homepage Index