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

[netCDF #NXI-317344]: Question about nc_create

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: [netCDF #NXI-317344]: Question about nc_create
  • Date: Wed, 22 Jul 2020 12:07:55 -0600

Hello Stefano,

NetCDF does not support single-writer/multi-reader in many cases. It is 
possible to use `nc_open_mem` and `nc_open_memio` to access data stored in 
memory, which may be an option for you.  You can also use `nc_sync()` to 
synchronize a dataset to disk, although you will need to coordinate the timing 
of this between your programs. 

I hope this helps,

-Ward

> Dear all,
> 
> I have to create a netCDF file to store a variable,
> 
> To create the file I use:
> 
> nc_create(<file path>, NC_NETCDF4|NC_SHARE, file_id);
> 
> In the meanwhile, I need to access to the file from another application to
> read the temporary status of the variable, but it seems that the content of
> the file is updated only when the writer close the file.
> 
> (the reader see an empty structure until the file is opened by the writer)
> 
> There is a way to share the file content?
> 
> Best Regards,
> Stefano
> 
> Ing. Stefano Morrocchi
> cid:image039.png@01D10271.818879E0
> Via Fiorentina, 17/D
> 50063 Figline Valdarno (FI)
> Tel. +39 055 9155580
> 
> 


Ticket Details
===================
Ticket ID: NXI-317344
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.