ns_pathname(3)

NAME

Ns_MakePath, Ns_NormalizePath, Ns_PathIsAbsolute - Path
name procedures

SYNOPSIS

#include "ns.h"
char *
Ns_MakePath(Ns_DString *dest, ...)
char *
Ns_NormalizePath(Ns_DString *dsPtr, char *path)
int
Ns_PathIsAbsolute(char *path)

DESCRIPTION

These functions operate on file pathnames. They work with
Unix and Windows pathnames on their respective hosts.
Ns_MakePath(dest, ...)

Construct a path name from a list of path elements.
The Ns_MakePath function constructs a path name by appending a
list of path elements to the given Ns_DString. The path elements
are separated by single slashes, and the resulting path name is
appended to the given Ns_DString. The last argument needs to be
NULL to indicate the end of the argument list.
Ns_NormalizePath(dsPtr, path)

Normalize a path name. This function removes any
extraneous slashes from the path and resolves "." and ".." ref
erences. The result is appended to the given Ns_DString. The fol
lowing code appends "/dog" to the Ns_DString:
Ns_NormalizePath(&ds,
"/dog/cat/../../rat/../../dog//mouse/..");
Ns_PathIsAbsolute(path)

Check for an absolute path name. Return NS_TRUE if
the path is absolute and NS_FALSE otherwise. Under Unix, an abso
lute path starts with a "/". On Windows, it starts with a drive
letter followed immediately by a ":".

SEE ALSO

nsd(1), info(n)

KEYWORDS

Copyright © 2010-2025 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout