VOS

From EDM2
Revision as of 15:49, 1 March 2017 by Ak120 (Talk | contribs)

Jump to: navigation, search

A class to interface with the host operating system in a platform independent fashion.

Synopsis

Header:
<v/vos.h>
Class name:
vOS

Description

This class is meant to provide a fairly platform independent way of interfacing with common system dependent functions.

Methods

int vDeleteFile(const char* filename)

Deletes the specified file.

int vChDrive(int drive)

On MS-Windows, changes to the specified disk drive, where "A:"==0, "B:"==1, and so on. This method has no effect on X.

int vGenEnvVal(char* name, char* val, int maxlen)

Returns to val the value of the environment variable specified in name. val has a maximum length of maxlen. The return value is false on failure to find the variable.

int vGetUserName(char* s, int len)

Returns to s a system dependent string corresponding to the current User Name.

void vGetHostName(char* s, int len)

Returns to s a system dependent string corresponding to the host name of the system.

long vGetPid()

Returns a system dependent value corresponding to the current process id.

int vGetCWD(char* s, int len)

Returns to s a system dependent string corresponding to the current working directory.

int vChDir(const char* path)

Changes active directory to the one specified by path.

int vRunProcess(const char* cmd, const char* StdOut, const char* StdErr, int Wait, int minimize)

This function is used to start an external process. cmd is used to specify the complete command line, e.g., "prog -s x.tmp". StdOut and StdErr may be used to specify a file name. If supplied, then standard out and standard error of the process will be redirected to those files. If Wait is true, then vRunProcess won't return until the process has terminated. If minimize is true, then the process will be started in a minimized state. vRunProcess return the exit code of the process.