MAKEPATH

Section: C Library Functions (3)
Updated: 2/22/89
Index Return to Main Contents
 

NAME

makepath - create intermediate directories for a path  

SYNOPSIS

char *makepath(path, refpath, trace, showerrs);

char *path, *refpath;
int trace, showerrs;
 

DESCRIPTION

Makepath creates any directories missing in path. If refpath is non-null, then it must have a non-null trailing subpath that is common to path. The entire path will be created if refpath is given and refpath is the path of a directory, otherwise only the components preceding the final component will be created for path.

If trace is non-zero, diagnostics will be printed to stderr. If showerrs is non-zero error messages will be printed to stderr.

Makepath return 0 if successfull, 1 otherwise.  

EXAMPLES

makepath("/foo/bar/baz", NULL, 1, 1);

will attempt create "/foo" and "/foo/bar", if they do not exist, printing out changes as they are made and errors, if they occur.  

SEE ALSO

mkdir(2)


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 12:50:20 GMT, May 26, 2025