[GRASS-SVN] r42570 -
grass/branches/develbranch_6/raster/r.statistics
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jun 17 02:40:42 EDT 2010
Author: hamish
Date: 2010-06-17 06:40:42 +0000 (Thu, 17 Jun 2010)
New Revision: 42570
Modified:
grass/branches/develbranch_6/raster/r.statistics/o_average.c
grass/branches/develbranch_6/raster/r.statistics/o_distrib.c
grass/branches/develbranch_6/raster/r.statistics/o_sum.c
Log:
use G_system(), avoid redirects (trac #1090)
Modified: grass/branches/develbranch_6/raster/r.statistics/o_average.c
===================================================================
--- grass/branches/develbranch_6/raster/r.statistics/o_average.c 2010-06-17 06:31:59 UTC (rev 42569)
+++ grass/branches/develbranch_6/raster/r.statistics/o_average.c 2010-06-17 06:40:42 UTC (rev 42570)
@@ -26,9 +26,9 @@
tempfile1 = G_tempfile();
tempfile2 = G_tempfile();
- sprintf(command, "%s -an input=\"%s,%s\" fs=space > \"%s\"",
+ sprintf(command, "%s -an input=\"%s,%s\" fs=space output=\"%s\"",
STATS, basemap, covermap, tempfile1);
- if (stat = system(command)) {
+ if (stat = G_system(command)) {
unlink(tempfile1);
G_fatal_error(_("%s: running %s command"), me, STATS);
}
@@ -62,9 +62,9 @@
out(fd2, basecat, sum1, sum2);
fclose(fd1);
fclose(fd2);
- sprintf(command, "%s input=\"%s\" output=\"%s\" < \"%s\"",
+ sprintf(command, "%s input=\"%s\" output=\"%s\" rules=\"%s\"",
RECLASS, basemap, outputmap, tempfile2);
- stat = system(command);
+ stat = G_system(command);
unlink(tempfile1);
unlink(tempfile2);
Modified: grass/branches/develbranch_6/raster/r.statistics/o_distrib.c
===================================================================
--- grass/branches/develbranch_6/raster/r.statistics/o_distrib.c 2010-06-17 06:31:59 UTC (rev 42569)
+++ grass/branches/develbranch_6/raster/r.statistics/o_distrib.c 2010-06-17 06:40:42 UTC (rev 42570)
@@ -23,10 +23,10 @@
tempfile1 = G_tempfile();
tempfile2 = G_tempfile();
- sprintf(command, "%s -cn input=\"%s,%s\" fs=space > \"%s\"", STATS, basemap,
- covermap, tempfile1);
+ sprintf(command, "%s -cn input=\"%s,%s\" fs=space output=\"%s\"", STATS,
+ basemap, covermap, tempfile1);
- if (stat = system(command)) {
+ if (stat = G_system(command)) {
unlink(tempfile1);
G_fatal_error(_("%s: running %s command"), me, STATS);
}
Modified: grass/branches/develbranch_6/raster/r.statistics/o_sum.c
===================================================================
--- grass/branches/develbranch_6/raster/r.statistics/o_sum.c 2010-06-17 06:31:59 UTC (rev 42569)
+++ grass/branches/develbranch_6/raster/r.statistics/o_sum.c 2010-06-17 06:40:42 UTC (rev 42570)
@@ -27,10 +27,10 @@
tempfile1 = G_tempfile();
tempfile2 = G_tempfile();
- sprintf(command, "%s -cn input=\"%s,%s\" fs=space > \"%s\"", STATS, basemap,
+ sprintf(command, "%s -cn input=\"%s,%s\" fs=space output=\"%s\"", STATS, basemap,
covermap, tempfile1);
- if (stat = system(command)) {
+ if (stat = G_system(command)) {
unlink(tempfile1);
G_fatal_error(_("%s: running %s command"), me, STATS);
}
@@ -65,9 +65,9 @@
sum_out(fd2, basecat, sum1);
fclose(fd1);
fclose(fd2);
- sprintf(command, "%s input=\"%s\" output=\"%s\" < \"%s\"",
+ sprintf(command, "%s input=\"%s\" output=\"%s\" rules=\"%s\"",
RECLASS, basemap, outputmap, tempfile2);
- stat = system(command);
+ stat = G_system(command);
unlink(tempfile1);
unlink(tempfile2);
More information about the grass-commit
mailing list