Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
archived/docs/technical/path.txt
2011-03-20 21:12:47 +02:00

48 lines
1.4 KiB
Text

Path - Path handling routines
=============================
This module implements common routines for dealing with paths.
Functions
---------
`is_abspath()`::
Returns a non zero value if 'path' is an absolute path. zero otherwise.
`is_file()`::
Returns a non zero value if 'path' is a regular file. zero otherwise.
`is_dir()`::
Returns a non zero value if 'path' is a directory. zero otherwise.
`mkpath()`::
Formats a "functional correct" path (that works with `open()`, `stat()` etc). +
Returns a staticly allocated string.
`path_normalize`::
Returns a string that contains the normalized full path specified by 'base', 'name' and 'dir'. +
The function performs this type of checks/manipulation:
+
--
* If the first character in 'base' is "~" it is expanded to the users home directory.
* Sequences of delimiters are replaced with one delimiter.
* Makes sure 'base' is an absolute path.
* 'name' must not contain an delimiter.
* terminates the string with an delimiter if 'dir' is non-zero.
--
+
Returns `NULL` if 'base' is not an absolute path or 'name' contains a delimiter.
`dirname_s`::
Safe dirname implementation. works like POSIX dirname with some modifications: +
+
--
* 'slash' may be used to terminate the string with a \'/' character. +
* The function will never modify 'path' instead the function will *always* return a static buffer that will be overwritten by subsequent calls.
--