osdExecute

osdExecute

osd

1998 12-05


NAME

osdExecute - execute a command


SYNOPSIS

int osdExecute(char *command, int *status, char **output)

osdExecute() executes the command specified by command. The argument status is a pointer to an integer into which the return status from the execution is placed. The argument output is a pointer to a pointer to characters into which the string consisting of the output from the execution of the command is placed. The caller is responsible for freeing, via osdFree(), the memory allocated for output.


On success osdExecute() returns TRUE, otherwise osdExecute() returns FALSE.


ARGUMENTS


command The command to be executed
status The status of the execution
env The output of the command


EXAMPLES

int status;
char *output;

status = 0;
output = NULL;
if (osdExecute("echo Hello, world!", &status, &output) && 0 == status)
{
	if (NULL != output)
	{
		printf("%s", output);
		osdFree(output);
	}
}