[GRASS-SVN] r43072 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 12 13:22:28 EDT 2010


Author: mmetz
Date: 2010-08-12 17:22:28 +0000 (Thu, 12 Aug 2010)
New Revision: 43072

Modified:
   grass/trunk/lib/vector/Vlib/open.c
Log:
avoid struct stat

Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2010-08-12 17:22:12 UTC (rev 43071)
+++ grass/trunk/lib/vector/Vlib/open.c	2010-08-12 17:22:28 UTC (rev 43072)
@@ -454,20 +454,19 @@
     /* delete support files if native format was opened for update (not head_only) */
     if (update && !head_only) {
 	char file_path[2000];
-	struct stat info;
 
 	sprintf(buf, "%s/%s", GV_DIRECTORY, name);
 
 	G__file_name(file_path, buf, GV_TOPO_ELEMENT, G_mapset());
-	if (stat(file_path, &info) == 0)	/* file exists? */
+	if (access(file_path, F_OK) == 0)	/* file exists? */
 	    unlink(file_path);
 
 	G__file_name(file_path, buf, GV_SIDX_ELEMENT, G_mapset());
-	if (stat(file_path, &info) == 0)	/* file exists? */
+	if (access(file_path, F_OK) == 0)	/* file exists? */
 	    unlink(file_path);
 
 	G__file_name(file_path, buf, GV_CIDX_ELEMENT, G_mapset());
-	if (stat(file_path, &info) == 0)	/* file exists? */
+	if (access(file_path, F_OK) == 0)	/* file exists? */
 	    unlink(file_path);
     }
 
@@ -879,7 +878,6 @@
     struct gvfile fp;
     struct Coor_info CInfo;
     struct Plus_head *Plus;
-    struct stat info;
 
     G_debug(1, "Vect_open_topo(): name = %s mapset= %s", Map->name,
 	    Map->mapset);
@@ -889,7 +887,7 @@
     sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
     G__file_name(file_path, buf, GV_TOPO_ELEMENT, Map->mapset);
 
-    if (stat(file_path, &info) != 0)	/* does not exist */
+    if (access(file_path, F_OK) != 0)	/* does not exist */
 	return 1;
 
     dig_file_init(&fp);



More information about the grass-commit mailing list