GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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.


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

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.

GRASS GIS Development Team

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.

-1 on error
status on success

Definition at line 51 of file system.c.

References G_warning(), NULL, and dialogs::w.

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