GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
paths.c File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <grass/gis.h>
Include dependency graph for paths.c:

Go to the source code of this file.

Functions

int G_mkdir (const char *path)
 Creates a new directory. More...
 
int G_is_dirsep (char c)
 Checks if a specified character is a valid directory separator character on the host system. More...
 
int G_is_absolute_path (const char *path)
 Checks if a specified path looks like an absolute path on the host system. More...
 
char * G_convert_dirseps_to_host (char *path)
 Converts directory separator characters in a string to the native host separator character (/ on Unix, \ on Windows) More...
 
char * G_convert_dirseps_from_host (char *path)
 Converts directory separator characters in a string from the native host character to the GRASS separator character (/) More...
 
int G_stat (const char *file_name, struct stat *buf)
 Get file status. More...
 
int G_lstat (const char *file_name, struct stat *buf)
 Get file status. More...
 

Function Documentation

char* G_convert_dirseps_from_host ( char *  path)

Converts directory separator characters in a string from the native host character to the GRASS separator character (/)

Parameters
pathString to be converted
Returns
Pointer to the string

Definition at line 95 of file paths.c.

char* G_convert_dirseps_to_host ( char *  path)

Converts directory separator characters in a string to the native host separator character (/ on Unix, \ on Windows)

Parameters
pathString to be converted
Returns
Pointer to the string

Definition at line 73 of file paths.c.

Referenced by db_read_dbmscap(), G_ask_datum_name(), G_ask_ellipse_name(), G_ask_proj_name(), and GPJ_ask_datum_params().

int G_is_absolute_path ( const char *  path)

Checks if a specified path looks like an absolute path on the host system.

Parameters
pathString containing path to check
Returns
1 if path looks like an absolute path, 0 if not

Definition at line 52 of file paths.c.

References G_is_dirsep().

Referenced by COM_Font_get().

int G_is_dirsep ( char  c)

Checks if a specified character is a valid directory separator character on the host system.

Parameters
cCharacter to check
Returns
1 if c is a directory separator character, 0 if not

Definition at line 35 of file paths.c.

Referenced by G_is_absolute_path(), G_parser(), and G_set_program_name().

int G_lstat ( const char *  file_name,
struct stat buf 
)

Get file status.

Returns information about the specified file.

Parameters
file_namefile name
statin the case of a symbolic link, the link itself is stat-ed, not the file that it refers to
Returns
Return value from system lstat function

Definition at line 135 of file paths.c.

References stat.

Referenced by G_recursive_copy().

int G_mkdir ( const char *  path)

Creates a new directory.

Creates a new directory with permissions 0777 (on Unix) or default permissions(?) on Windows.

Parameters
pathString containing path of directory to be created
Returns
Return value from system mkdir() function

Definition at line 17 of file paths.c.

Referenced by G__make_location(), G__make_mapset(), G__make_mapset_element(), G_recursive_copy(), make_location(), and make_mapset().

int G_stat ( const char *  file_name,
struct stat buf 
)

Get file status.

Returns information about the specified file.

Parameters
file_namefile name
stat
Returns
Return value from system lstat function

Definition at line 118 of file paths.c.

References stat.

Referenced by G__mapset_permissions(), and G__mapset_permissions2().