[GRASSLIST:1543] file creation / output problem in custom GRASS program (C)

Scott W. Mitchell smitch at eos.geog.utoronto.ca
Wed Feb 28 13:01:47 EST 2001

A GRASS/C programming problem I'm having, just in case it sounds familiar
to someone:

I'm trying to add functionality to an old grass4 program we've been using
here for ages, and I'm having troubles in that now I don't get any output
in the external file the program is supposed to generate.  In fact, the
file is never created.  The code manages the file through fopen, fprintf,
fclose, and now I've even tried adding some fflushes.  The code checks for
a successful fopen and apparently succeeds.  However, the file is never

The portions of code I have changed are, as far as I can determine,
completely unrelated to any of this file access, or even to the data being
output.  Adding some prints to standard output have shown that the data is
being generated fine.

Thankfully, I changed the name of the binary in the Gmakefile, so I still
have my old one to try, and it is working fine.  It was compiled quite a
while ago, and there have definitely been library changes etc on the
system since then.  Perhaps even a compiler upgrade.

I am using grass4.3 compiled by myself last Fall, on Corel Linux rev 2
with many updates from Debian (many of these are SINCE the grass
compile).  Some relevant versions (Debian packages, similar to RPMs):

ii  gcc             2.95.2-13      The GNU C compiler.
ii  libc5           5.4.46-3       The Linux C library version 5 (run-time
ii  libc6           2.1.3-10       GNU C Library: Shared libraries and
ii  libc6-dbg       2.1.3-10       GNU C Library: Libraries with debugging
ii  libc6-dev       2.1.3-10       GNU C Library: Development Libraries
and Hea
ii  ldso            1.9.11-9       The Linux dynamic linker, library and

I will keep working on this, but have been grasping at straws all morning
so want to send this in case any other programmers have come across
something like it...

Scott Mitchell
University of Toronto
smitch at geog.utoronto.ca

More information about the grass-user mailing list