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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 19 13:57:56 EDT 2010


Author: mmetz
Date: 2010-05-19 13:57:55 -0400 (Wed, 19 May 2010)
New Revision: 42320

Modified:
   grass/trunk/lib/vector/Vlib/open.c
   grass/trunk/lib/vector/Vlib/open_nat.c
Log:
Vlib: Do not check mtime because mtime is changed by copy

Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2010-05-19 10:55:03 UTC (rev 42319)
+++ grass/trunk/lib/vector/Vlib/open.c	2010-05-19 17:57:55 UTC (rev 42320)
@@ -776,27 +776,10 @@
 
     switch (Map->format) {
     case GV_FORMAT_NATIVE:
-	sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
-	G__file_name(path, buf, GV_COOR_ELEMENT, Map->mapset);
-	G_debug(1, "get coor info: %s", path);
-	if (0 != stat(path, &stat_buf)) {
-	    G_warning(_("Unable to stat file <%s>"), path);
-	    Info->size = -1L;
-	    Info->mtime = -1L;
-	}
-	else {
-	    Info->size = (off_t) stat_buf.st_size;	/* file size */
-	    Info->mtime = (long)stat_buf.st_mtime;	/* last modified time */
-	}
-	/* stat does not give correct size on MINGW 
-	 * if the file is opened */
-#ifdef __MINGW32__
-	if (Map->open == VECT_OPEN_CODE) {
-	    dig_fseek(&(Map->dig_fp), 0L, SEEK_END);
-	    G_debug(2, "dig_ftell = %d", dig_ftell(&(Map->dig_fp)));
-	    Info->size = dig_ftell(&(Map->dig_fp));
-	}
-#endif
+	dig_fseek(&(Map->dig_fp), 0L, SEEK_END);
+	G_debug(2, "dig_ftell = %d", dig_ftell(&(Map->dig_fp)));
+	Info->size = dig_ftell(&(Map->dig_fp));
+	Info->mtime = 0L;
 	break;
     case GV_FORMAT_OGR:
     case GV_FORMAT_OGR_DIRECT:

Modified: grass/trunk/lib/vector/Vlib/open_nat.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open_nat.c	2010-05-19 10:55:03 UTC (rev 42319)
+++ grass/trunk/lib/vector/Vlib/open_nat.c	2010-05-19 17:57:55 UTC (rev 42320)
@@ -59,10 +59,6 @@
         return -1;
     }
 
-    /* needed to determine file size, Map->head.size will be updated by dig__read_head(Map) */
-    Vect_coor_info(Map, &CInfo);
-    Map->head.size = CInfo.size;
-
     if (!(dig__read_head(Map)))
 	return (-1);
 
@@ -103,7 +99,7 @@
     Map->head.Back_Major = GV_COOR_EARLIEST_MAJOR;
     Map->head.Back_Minor = GV_COOR_EARLIEST_MINOR;
 
-    /* TODO open better */
+    /* TODO: open better */
     dig_file_init(&(Map->dig_fp));
     Map->dig_fp.file = G_fopen_new(buf, GV_COOR_ELEMENT);
     if (Map->dig_fp.file == NULL)



More information about the grass-commit mailing list