ntpath β
Path operations for Windows/NT-style paths.
π‘Python
ntpath-style behavior, ported to Lua.
Usage β
lua
ntpath = require "mods.ntpath"
print(ntpath.join([[C:\]], "Users", "me")) --> "C:\Users\me"
print(ntpath.normcase([[A/B\C]])) --> [[a\b\c]]
print(ntpath.splitdrive([[C:\Users\me]])) --> "C:", [[\Users\me]]
print(ntpath.isreserved([[C:\Temp\CON.txt]])) --> true⨠Same API as
mods.path, but with Windows/NT path semantics.
Functions β
ismount(path) β
Return true when path points to a mount root.
Parameters:
path(string): Path to inspect.
Return:
isMount(boolean):trueif the path resolves to a mount root.
Example:
lua
ntpath.ismount([[C:\]]) --> trueisreserved(path) β
Return true when path contains a reserved NT filename.
Parameters:
path(string): Path to inspect.
Return:
isReserved(boolean):trueif any component is NT-reserved.
Example:
lua
ntpath.isreserved([[a\CON.txt]]) --> true