GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rename.c File Reference

GIS Library - Rename file functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <grass/gis.h>
Include dependency graph for rename.c:

Go to the source code of this file.

Functions

int G_rename_file (const char *oldname, const char *newname)
 Rename a file in the filesystem. More...
 
int G_rename (const char *element, const char *oldname, const char *newname)
 Rename a database file. More...
 

Detailed Description

GIS Library - Rename file functions.

(C) 2001-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
GRASS GIS Development Team
Date
1999-2006

Definition in file rename.c.

Function Documentation

int G_rename ( const char *  element,
const char *  oldname,
const char *  newname 
)

Rename a database file.

The file or directory oldname under the database element directory in the current mapset is renamed to newname.

Bug: This routine does not check to see if the newname name is a valid database file name.

Parameters
[in]element
[in]oldname
[in]newname
Returns
0 if oldname does not exist
1 if successful
-1 on error

Definition at line 62 of file rename.c.

References G__file_name(), G__name_is_fully_qualified(), G_mapset(), G_rename_file(), xmapset, and xname.

Referenced by Vect_rename().

int G_rename_file ( const char *  oldname,
const char *  newname 
)

Rename a file in the filesystem.

The file or directory oldname is renamed to newname.

Parameters
[in]oldname
[in]newname
Returns
0 if successful
-1 on error

Definition at line 35 of file rename.c.

Referenced by G_rename().