Module: nupp.io.Path
Constructors and platform operations for immutable filesystem paths.
Module contents
Constructors
| Constructor | Description |
|---|---|
new | Creates a path by joining one or more components. |
Functions
| Function | Kind | Description |
|---|---|---|
currentDirectory | function | Reads the process's current working directory. |
separator | function | Returns the current platform's primary path separator. |
Constructors#
newconstructor#
Creates a path by joining one or more components.
Examples#
Build a path from components:
Normalize the path after joining its components:
Arguments
| Name | Type | Description |
|---|---|---|
first | string | the first path component |
... | string | the remaining path components |
Returns
| Type | Description |
|---|---|
Path | the new path |
Functions#
currentDirectoryfunction#
Reads the process's current working directory.
local currentDirectory: function(): (Path?, string?)Returns
| Type | Description |
|---|---|
Path? | the current directory, or nil on failure |
string? | a failure reason, when unsuccessful |
separatorfunction#
Returns the current platform's primary path separator.
local separator: function(): stringReturns
| Type | Description |
|---|---|
string | the path separator |