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: Thursday Feb 03 11:10:06 2022 in commit: 547ff44e6aecfb4c9cbf6a4717fc14e521bec0be
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 8.2.2dev Reference Manual