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

[netCDF #TAI-783869]: Reg: Opening a .nc file using Visual Studio

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 Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu

Ticket Details
Ticket ID: TAI-783869
Department: Support netCDF
Priority: High
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.