This function is used to open a new data file for NCL.


	function addfile ( 
		file_path[ 1 ] : string, 
		status[ 1 ] : string 


Single string that is the full or relative path of the data file to load.
Single string that specifies whether the file should be open as a read only file or as a read-write file.


The addfile function returns a reference to the file pointed to by the file_path argument. The file pointed to by the file_path string must be a supported file format and have the supported file extension at the end of its file name. For example, ".nc" and ".cdf" are supported file extensions for the netCDF data format. The status parameter can be either "r" for read only, "w" for read-write or "c" for create. When "c" is set, the file is created if it doesn't exist. If it does exist, an error message is printed and the default missing value for files is returned. When "w" is set, the file exists and the permissions allow reading and writing, and the file is opened for reading and writing. If any of these conditions fail, an error message is reported and the default file missing value is returned. Similarly, if "r" is set, the file must exist and the user must have read permissions on that file; otherwise an error message is printed and the default missing value is returned. See the ismissing function on how to detect the returned missing value in a program.

(See Supported data format information for a list of supported data formats, the appropriate file extensions and other specific information on each supported format.)

Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?

$Revision: 1.12 $ $Date: 1998/06/15 21:28:54 $