Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 413e0bdb3c48563b2d8d9038d07d5533 > files > 1573

grass-6.3.0-15.fc13.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>GRASS GIS: g.filename</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body bgcolor="white">

<img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade>

<h2>NAME</h2>
<em><b>g.filename</b></em>  - Prints GRASS data base file names.
<h2>KEYWORDS</h2>
general
<h2>SYNOPSIS</h2>
<b>g.filename</b><br>
<b>g.filename help</b><br>
<b>g.filename</b> <b>element</b>=<em>string</em> <b>file</b>=<em>string</em>  [<b>mapset</b>=<em>string</em>]   [--<b>verbose</b>]  [--<b>quiet</b>] 


<h3>Parameters:</h3>
<DL>
<DT><b>element</b>=<em>string</em></DT>
<DD>Name of an element</DD>

<DT><b>file</b>=<em>string</em></DT>
<DD>Name of a database file</DD>

<DT><b>mapset</b>=<em>string</em></DT>
<DD>Name of a mapset (default: current)</DD>

</DL>
<H2>DESCRIPTION</H2>

<em>g.filename</em> is designed for Bourne shell scripts that need to know 
the full file name, including it's path, for mapset elements, like raster,
vector and site maps, region definitions and imagery groups.
<p>
The list of element names to search for is not fixed; any subdirectory of the
mapset directory is a valid element name.
<p>
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/g.copy use to determine which files need to be
deleted/renamed/copied for a given entity type.

<!-- unused
<H2>OPTIONS</H2>

<H3>Parameters:</H3>

<DL>
<DT><B>element=</B><EM>name</EM> 

<DD>The name of a GRASS data base element (i.e., directory
within the GRASS mapset location).

<DT><B>mapset=</B><EM>name</EM> 

<DD>The name of a GRASS data base mapset.  As a
convenience, a single dot (.) can be used to designate the
current mapset.

<DT><B>file=</B><EM>name</EM> 

<DD>The name of a GRASS data base file.
</DL>
-->
<H2>OUTPUT</H2>

<EM>g.filename</EM>
writes one line to standard output:

<DL>
<DD>
file='<EM>full_file_pathname'</EM>
</DL>

The output is a <EM>/bin/sh</EM> command to set the
variable specified by the file <EM>name</EM> to the full
UNIX path name for the data base file.  This variable may
be set in the <EM>/bin/sh</EM> as follows:

<DL>
<DD>
<div class="code"><pre>
eval `g.filename element=<em>name</em> mapset=<em>name</em> file=<em>name</em>`
</pre></div>
</DL>


<H2>NOTES</H2>

This routine generates the filename, but does not care if the file (or mapset
or element) exists or not. This feature allows shell scripts to create new data
base files as well as use existing ones.

<P>

If the mapset is the current mapset, <EM>g.filename</EM>
automatically creates the <EM>element</EM> specified if it
doesn't already exist.  This makes it easy to add new files
to the data base without having to worry about the
existence of the required data base directories.  (This
program will not create a new mapset, however, if that
specified does not currently exist.)

<P>
The program exits with a 0 if everything is ok;  it exits
with a non-zero value if there is an error, in which case
file=<EM>'full_file_pathname'</EM> is not output.

<H2>SEE ALSO</H2>

<EM><A HREF="g.ask.html">g.ask</A></EM><br>
<EM><A HREF="g.findfile.html">g.findfile</A></EM><br>
<EM><A HREF="g.gisenv.html">g.gisenv</A></EM><br>
<EM><A HREF="parser.html">parser</A></EM>

<H2>AUTHOR</H2>

Michael Shapiro,
U.S.Army Construction Engineering Research Laboratory

<p><i>Last changed: $Date: 2006-10-25 17:30:49 +0200 (Wed, 25 Oct 2006) $</i>
<HR>
<P><a href="index.html">Main index</a> - <a href="general.html">general index</a> - <a href="full_index.html">Full index</a></P>
<P>&copy; 2003-2008 <a href="http://grass.osgeo.org">GRASS Development Team</a></p>
</body>
</html>