Difference between revisions of "Dbrun()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 12: Line 12:
  
 
<input parameters>
 
<input parameters>
char *command; /* Address of a buffer containing an  
+
char *command; /* Address of a buffer containing an operating system command */
operating system command */
+
  
 
<output Parameters>
 
<output Parameters>

Revision as of 09:54, 2 April 2009

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()