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.
Hi Rekha, > I have the below code in my program which tries to open the fort.74.ncfile. > > if ((retval = nc_open("fort.74.nc", 0, &ncid))) > > But for some reason it is showing an error result of 2 which means there is > no such file. I am using Visual Studio 2012 and I have placed this .nc file > in my resource file section as well. I just wanted to know whether I need > to specify the file path or something or need to place the .nc file in some > other location. Please help! You need to specify a file path if your program is started (invoked) from a different directory than the one in which your file is located. If your file is in the same directory from which your program is run, then the example above should work fine, assuming the file permissions don't restrict read access. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: TAI-783869 Department: Support netCDF Priority: High Status: Closed