.TH OS 2
.SH NAME
Os \- helper module for interfacing with the host OS
.SH SYNOPSIS
.EX
include "os.m";
os := load Os Os->PATH;
init: fn();
filename: fn(name: string): string;
run: fn(cmd: string) : (string, string);
host: string;
.EE
.SH DESCRIPTION
.B Os
provides operations common in most servers that export resources from the host
OS. The module must be initialized by calling
.I init
before using any of its other facilities.
.PP
.I Filename
returns a string for the file named
.I name
in a format understood by the underlying system. In particular, it takes care of
adding the value of
.B $emuhost
as a prefix to the file name given. It is useful to execute host commands that refer to
files known to us, but kept in the host file system.
.PP
.I Run
executes
.I cmd
in the host system shell and returns a tuple with the command output and
an error string.
.PP
.I Host
returns a string with the value of
.B $emuhost
(which is usually needed to select appropriate commands).
.SH SOURCE
.B /usr/octopus/port/lib/os.b
.SH SEE ALSO
.IR cmd (3).
|