VOS
A class to interface with the host operating system in a platform independent fashion.
Contents
- 1 Synopsis
- 2 Description
- 3 Methods
- 3.1 int vDeleteFile(const char* filename)
- 3.2 int vChDrive(int drive)
- 3.3 int vGenEnvVal(char* name, char* val, int maxlen)
- 3.4 int vGetUserName(char* s, int len)
- 3.5 void vGetHostName(char* s, int len)
- 3.6 long vGetPid()
- 3.7 int vGetCWD(char* s, int len)
- 3.8 int vChDir(const char* path)
- 3.9 int vRunProcess(const char* cmd, const char* StdOut, const char* StdErr, int Wait, int minimize)
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.