CCP4 web logo CCP4i: Graphical User Interface
Documentation for Programmers
GetFileFormat

next button previous button top button

NAME

GetFileFormat - Get the CCP4i standard name for a file format

SYNOPSIS

GetFileFormat filename [default]

DESCRIPTION

For the given file name filename work out the file format based on the file extension and return the CCP4i standard name for a file format. If the file extension does not correspond to any registered with CCP4i then return the default default which is usually a null character.

The file formats and extensions known to CCP4i are defined in $CCP4I_top/etc/types.def. For example the line defining the heavy atom file type is:

set typedef(_ha_file)
{file HA .ha "Heavy atom frac coord" {"Edit HA file"} {HAViewer} }
Here the information relating to the HA file type is stored as the _ha_file element of the typedef array. The information is in the form of a list (the braces { } enclose the items in the list). The items of the list are:
file
Says this is defining a file type
HA
The name of the file type
.ha
The standard file extension
"Heavy atom frac coord"
Text used in the interface when referring to the file type
{"Edit HA file"}
A list of text used when giving the user the option to select the means of viewing the file (currently there is only one option)
{HAViewer}
A list of the procedures used to display this type of file

KEYWORDS