cleanup, docs
This commit is contained in:
@@ -2,17 +2,18 @@
|
||||
String path_join(String base, String child)
|
||||
|
||||
:params
|
||||
base : parent path
|
||||
child : child path or absolute override
|
||||
return value : combined path
|
||||
base : base path
|
||||
child : path to append
|
||||
return value : the two joined with a single separator
|
||||
|
||||
:content
|
||||
Joins two path fragments with exactly one separator, regardless of whether `base` ends in a slash or `child` begins with one. Use it instead of string concatenation to build paths safely.
|
||||
|
||||
:example
|
||||
print(path_join("/var/www", "site/index.uce"), "\n");
|
||||
|
||||
:see
|
||||
>sys
|
||||
|
||||
:content
|
||||
Joins two filesystem-style path fragments with a single `/` when needed.
|
||||
|
||||
If `child` is empty, `base` is returned. If `child` already starts with `/`, it is returned unchanged. That makes `path_join()` a better fit for app-level path assembly than open-coded string concatenation.
|
||||
|
||||
:example
|
||||
print("path_join example\n");
|
||||
basename
|
||||
dirname
|
||||
path_real
|
||||
|
||||
Reference in New Issue
Block a user