Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.
The list of element names to search for is not fixed; any subdirectory of the mapset directory is a valid element name.
However, the user can find the list of standard GRASS element names in the file $GISBASE/etc/element_list. This is the file which g.remove, g.rename and g.copy use to determine which files need to be deleted/renamed/copied for a given entity type.
name='file_name' mapset='mapset_name' file='unix_filename' fullname='grass_fullname'
eval `g.findfile element=name mapset=name file=name`
eval `g.findfile element=cell file=elevation`
name= mapset= fullname= file=
if [ ! "$file" ] then exit 1 fi
Vector map example (including error message):
eval `g.findfile element=vector file="$G_OPT_V_INPUT"` if [ ! "$file" ] ; then g.message -e "Vector map <$G_OPT_V_INPUT> not found" exit 1 fi
Note: The Python tab in the wxGUI can be used for entering the following code:
import grass.script as gcore gcore.find_file('elevation', element = 'cell')
Available at: g.findfile source code (history)
Latest change: Mon Nov 18 20:15:32 2019 in commit: 1a1d107e4f6e1b846f9841c2c6fabf015c5f720d
Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.
Main index | General index | Topics index | Keywords index | Graphical index | Full index
© 2003-2023 GRASS Development Team, GRASS GIS 7.8.8dev Reference Manual