system.c File Reference

GIS Library - Command execution functions. More...

#include <grass/config.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for system.c:

Go to the source code of this file.

Functions

int G_system (const char *command)
 Run a shell level command.

Detailed Description

GIS Library - Command execution functions.

(C) 2001-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author:
GRASS GIS Development Team
Date:
1999-2008

Definition in file system.c.


Function Documentation

int G_system ( const char *  command  ) 

Run a shell level command.

This is essentially the UNIX system() call, except for the signal handling. During the call, user generated signals (intr, quit) for the parent are ignored, but allowed for the child. Parent signals are reset upon completion.

This routine is useful for menu type programs that need to run external commands and allow these commands to be interrupted by the user without killing the menu itself.

Note: if you want the signal settings to be the same for the parent and the command being run, set them yourself and use the UNIX system() call instead.

Parameters:
[in] command 
Returns:
-1 on error
status on success

Definition at line 51 of file system.c.

References G_warning().

Referenced by G_ask_datum_name(), G_ask_ellipse_name(), and G_ask_proj_name().

Generated on Tue Apr 6 13:27:52 2010 for GRASS Programmer's Manual by  doxygen 1.6.3