[GRASS-SVN] r43585 - grass/branches/releasebranch_6_4/raster/r.statistics

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 21 09:12:08 EDT 2010


Author: neteler
Date: 2010-09-21 13:12:07 +0000 (Tue, 21 Sep 2010)
New Revision: 43585

Modified:
   grass/branches/releasebranch_6_4/raster/r.statistics/o_average.c
   grass/branches/releasebranch_6_4/raster/r.statistics/o_distrib.c
   grass/branches/releasebranch_6_4/raster/r.statistics/o_sum.c
Log:
backport: use G_system(), avoid redirects (trac #1090)

Modified: grass/branches/releasebranch_6_4/raster/r.statistics/o_average.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.statistics/o_average.c	2010-09-21 13:08:34 UTC (rev 43584)
+++ grass/branches/releasebranch_6_4/raster/r.statistics/o_average.c	2010-09-21 13:12:07 UTC (rev 43585)
@@ -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/releasebranch_6_4/raster/r.statistics/o_distrib.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.statistics/o_distrib.c	2010-09-21 13:08:34 UTC (rev 43584)
+++ grass/branches/releasebranch_6_4/raster/r.statistics/o_distrib.c	2010-09-21 13:12:07 UTC (rev 43585)
@@ -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/releasebranch_6_4/raster/r.statistics/o_sum.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.statistics/o_sum.c	2010-09-21 13:08:34 UTC (rev 43584)
+++ grass/branches/releasebranch_6_4/raster/r.statistics/o_sum.c	2010-09-21 13:12:07 UTC (rev 43585)
@@ -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