[GRASS-user] r.patch: GRASS-6.5svn

Glynn Clements glynn at gclements.plus.com
Fri Jan 22 00:47:04 EST 2010


Rich Shepard wrote:

> GRASS 6.5.svn (Oregon):/usr4/grassbase > r.patch in=$MAPS out=demOR --o
> WARNING: map [demOR] - unable to write row 24578 (No such file or
>           directory)

"No such file or directory" is ENOENT, which isn't among the errors
which write() can return. That suggests that write() is succeeding,
but returning a short count (i.e. it wrote some data, not all of it). 
I suspect that a subsequent write() will result in an actual error and
indicate the cause, but write_error() only reports the first error (so
that you don't get thousands of them).

Can you revert the previous patch with:

	patch -R -p0 < write_errno.patch

then apply the attached patch with:

	patch -R -p0 < write_errors.patch

and re-compile.

That should cause it to print more than one error.

Also, can you provide the output from:

	ls -l /usr4/grassbase/Oregon/PERMANENT/cell/demOR

BTW, do you get similar errors with other commands using the same
region, e.g.:

	r.mapcalc 'test = rand(9999)'
?

-- 
Glynn Clements <glynn at gclements.plus.com>

-------------- next part --------------
Index: lib/gis/put_row.c
===================================================================
--- lib/gis/put_row.c	(revision 40542)
+++ lib/gis/put_row.c	(working copy)
@@ -122,6 +122,7 @@
  **********************************************************************/
 
 #include <string.h>
+#include <errno.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -304,12 +305,13 @@
 {
     struct fileinfo *fcb = &G__.fileinfo[fd];
 
-    if (fcb->io_error)
+    if (fcb->io_error > 2)
 	return;
 
-    G_warning(_("map [%s] - unable to write row %d"), fcb->name, row);
+    G_warning(_("map [%s] - unable to write row %d (%s)"), fcb->name, row,
+	      strerror(errno));
 
-    fcb->io_error = 1;
+    fcb->io_error++;
 
     return;
 }


More information about the grass-user mailing list