[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20020827: Netcdf 3.5.0 fails with linux on FAT32 partition



>To: address@hidden
>From: Andreas Manschke <address@hidden>
>Subject: Netcdf 3.5.0 fails with linux on FAT32 partition
>Organization: UCAR/Unidata
>Keywords: 200208270859.g7R8xDZ02976

Andreas,

It turns out that the POSIX function ftruncate() does not work on
Linux FAT32 file systems if it is used to try to extend the size of a
file; instead it returns -1 indicating this is an illegal operation.
NetCDF uses ftruncate() if it is available, but I don't think it
really needs to use it.

One simple workaround is to ensure that the macro HAVE_FTRUNCATE is
not defined when the file src/libsrc/posixio.c is compiled; currently
it is defined to 1 in the file src/libsrc/ncconfig.h, which is
generated by the configure script from src/libsrc/ncconfig.in.  So if
you just delete or comment out the line

  #define HAVE_FTRUNCATE 1

in src/libsrc/ncconfig.h and then "make all test install", you should
get a library that works for both ordinary and FAT32 file systems.

A better fix is probably for us to just not use ftruncate(), but I'll
have to consider the implications of that before the next release.

Please let us know if this doesn't work for you.  With this change,
"make test" seems to work with all the tests of the C library.

--Russ