[GRASS-SVN] r55072 - grass-addons/grass6/vector/v.in.ply

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Feb 15 16:59:51 PST 2013


Author: hamish
Date: 2013-02-15 16:59:51 -0800 (Fri, 15 Feb 2013)
New Revision: 55072

Modified:
   grass-addons/grass6/vector/v.in.ply/v.in.ply
Log:
test to see if the file exists

Modified: grass-addons/grass6/vector/v.in.ply/v.in.ply
===================================================================
--- grass-addons/grass6/vector/v.in.ply/v.in.ply	2013-02-15 22:08:41 UTC (rev 55071)
+++ grass-addons/grass6/vector/v.in.ply/v.in.ply	2013-02-16 00:59:51 UTC (rev 55072)
@@ -53,6 +53,7 @@
     exec g.parser "$0" "$@"
 fi
 
+#needed?
 PROG=`basename "$0"`
 
 #### check if we have awk
@@ -66,7 +67,16 @@
 LC_NUMERIC=C
 export LC_NUMERIC
 
+
+if [ ! -e "$GIS_OPT_FILE" ] ; then
+    g.message -e "File not found <$GIS_OPT_FILE>"
+    exit 1
+fi
+
+
+# no-op?
 cat "$GIS_OPT_FILE" | awk "/ply/,/end_header/" > /dev/null
+
 DATALINES=`head -n 30 "$GIS_OPT_FILE" | grep 'element vertex' | cut -d' ' -f3`
 # TODO: test for valid number of lines here.
 



More information about the grass-commit mailing list