Dbrun()

From Recital Documentation Wiki
Revision as of 09:54, 2 April 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

execute an operating system command


SYNOPSIS

#include <dbl.h
 
	int	dbrun(command)
 
	<input parameters>
	char	*command;		/* Address of a buffer containing an 
	operating system command	*/
 
	<output Parameters>
	none


RETURN VALUE

The dbrun() function returns 0 for success or < 0 if an error occurs. See the section on return code values for a detailed list of return codes.


DESCRIPTION

The dbrun() function executes an operating system command. Any valid operating system command can be specified.


EXAMPLE

The first example runs the UNIX "rm" command.

#include "dbl.h"
 
	int	rc;	/* Return code */
 
	rc = dbrun("rm *.bak");
	if (rc != SUCCESS){
		printf("error no %dn", rc);
		exit(1);
	}
 
The second example runs the OpenVMS "purge" command.
 
<code lang="c">
#include "dbl.h"
 
	int	rc;	/* Return code */
 
	rc = dbrun("purge/log");
	if (rc != SUCCESS){
		printf("error no %dn", rc);
		exit(1);
	}


SEE ALSO

dbdo()