Am Wed, 28 Oct 2009 10:15:01 -0500
schrieb Rob Ross <rross@xxxxxxxxxxx>:
> Hi Thomas,
Hi Rob (I did't want to be rude before;-)!
> I agree that there should be a way to force an fsync() of the file
> via nc_ calls.
Well, the most difficult thing would be to figure out a proper name, then;-)
nc_fsync() would be a short possiblity. Well, then one needs to read up on
equivalent functionality on non-UNIX systems (well, MS Windows), but that
function may also simply be a no-op for systems that don't support it.
While at it, I suggest adding nc_readlock(), nc_writelock() and nc_unlock() ...
as proxies for fcntl(SETLK, ...) with types F_RDLCK, F_WRLCK and F_UNLCK,
respectively. Even on the same machine, without network file systems around,
one might want to be a bit careful with concurrent access to NetCDF files and
rather use file system locking to synchronize processes.
Well, but here it again could get a bit hairy with portability to different
platforms...
Main point of this discussion is the nc_fsync(), or any better named function,
to time actual data write action, and I would be happy if it could make its way
into a future NetCDF release.
Would there possibly be someone of the dev team hack this up trivially or is it
preferred that someone like me starts to dig into the code, tries to figure it
out, and then posts a hacky patch? I could only test the UNIX side of things,
though (Solaris, Linux... given enough time even Tru64;-).
Alrighy then,
Thomas.
--
Dipl. Phys. Thomas Orgis
Atmospheric Modelling
Alfred-Wegener-Institute for Polar and Marine Research