About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/paramgetpath.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 paccess Context: paramio

Synopsis

Returns the path to the specified parameter file.

Syntax

String_Type paccess( String_Type paramfile )
String_Type paccess( String_Type paramfile, String_Type mode )
or
Int_Type paccess( Param_File_Type pfile, String_Type param )

String_Type paramgetpath( String_Type paramfile )
String_Type paramgetpath( Param_File_Type pfile )

Description

The paccess() and paramgetpath() routines are used to find out whether parameters and parameter files are accessible.

paccess()

There are two forms of the paccess() call:

  • first argument is a string
  • first argument is a Param_File_Type variable

If given a string as the first argument then paccess() will return the full path to the parameter file, or NULL if it can not be found or the parameter file can not be accessed using the supplied mode (the optional second argument). If NULL is returned then the PF_Errno variable will be set to a non-zero value (see "ahelp paramio" for more information on this variable).

If given a Param_File_Type variable as the first argument then paccess() returns 1 if the second argument is listed in the parameter file, or 0 if not.

paramgetpath()

The paramgetpath() function returns the location of the parameter file for the given argument, which can be either the name of the parameter file or the Param_File_Type variable returned by paramopen(). If no parameter file can be found then NULL is returned and the PF_Errno variable will be set to a non-zero value (see "ahelp paramio" for a list of the values this variable can take).

Example 1

chips> require("paramio")
chips> paccess("dmlist")
/home/ciaouser/cxcds_param/dmlist.par

Example 2

chips> fp = paramopen("dmlist")
chips> paramgetpath(fp)
/home/ciaouser/cxcds_param/dmlist.par

Example 3

chips> fp = paramopen( "dmcopy" )
chips> paccess( fp, "infile" )
1
chips> paccess( fp, "value" )
0

CHANGES IN CIAO 3.2

The paccess() function now has two modes of operation. When called with a String_Type variable as its first argument it behaves as it did prior to CIAO 3.2, and returns the full path to the parameter file. The new mode is enabled when the first argument is a Param_File_Type variable, in which case the function returns 1 if the second argument is the name of a variable defined in the parameter file, or 0 otherwise.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.