[GRASS-SVN] r31847 - grass/trunk/vector/v.out.ascii

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 26 00:59:33 EDT 2008


Author: hamish
Date: 2008-06-26 00:59:33 -0400 (Thu, 26 Jun 2008)
New Revision: 31847

Modified:
   grass/trunk/vector/v.out.ascii/out.c
Log:
output=- sends to stdout (merge from devbr6)

Modified: grass/trunk/vector/v.out.ascii/out.c
===================================================================
--- grass/trunk/vector/v.out.ascii/out.c	2008-06-26 04:56:54 UTC (rev 31846)
+++ grass/trunk/vector/v.out.ascii/out.c	2008-06-26 04:59:33 UTC (rev 31847)
@@ -1,5 +1,4 @@
 /*
- *
  ****************************************************************************
  *
  * MODULE:     v.out.ascii
@@ -7,8 +6,8 @@
  *             James Westervelt, U.S. Army Construction Engineering Research Laboratory
  *             Radim Blazek, ITC-Irst, Trento, Italy
  *
- * PURPOSE:    r.out.ascii: writes ASCII GRID file
- * COPYRIGHT:  (C) 2000 by the GRASS Development Team
+ * PURPOSE:    v.out.ascii: writes GRASS vector data as ASCII files
+ * COPYRIGHT:  (C) 2000-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
@@ -21,6 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <string.h>
 #include <grass/gis.h>
 #include <grass/Vect.h>
 #include <grass/glocale.h>
@@ -129,6 +129,9 @@
 	if (ver == 4) {
 	    ascii = G_fopen_new("dig_ascii", output->answer);
 	}
+	else if( strcmp(output->answer, "-") == 0 ) {
+	    ascii = stdout;
+	}
 	else {
 	    ascii = fopen(output->answer, "w");
 	}



More information about the grass-commit mailing list