package
0.0.0-20250120080617-bb7c638c6f78
Repository: https://github.com/chainreactors/mals.git
Documentation: pkg.go.dev

# README

filepath GoDoc

Usage

local filepath = require("filepath")

-- filepath.ext()
local result = filepath.ext("/var/tmp/file.name")
if not(result == ".name") then error("ext") end

-- filepath.basename()
local result = filepath.basename("/var/tmp/file.name")
if not(result == "file.name") then error("basename") end

-- filepath.dir()
local result = filepath.dir("/var/tmp/file.name")
if not(result == "/var/tmp") then error("dir") end

-- filepath.join()
local result = filepath.join("/var", "tmp", "file.name")
if not(result == "/var/tmp/file.name") then error("join") end

-- filepath.glob()
local result = filepath.glob("/var/*/*.name")
if not(result[1] == "/var/tmp/file.name") then error("glob") end

# Functions

Abs returns an absolute representation of path.
Basename lua filepath.basename(path) returns the last element of path.
Clean returns the shortest path name equivalent to path.
Dir lua filepath.dir(path) returns all but the last element of path, typically the path's directory.
EvalSymlinks returns the path name after the evaluation of any symbolic link.
Ext lua filepath.ext(path) returns the file name extension used by path.
FromSlash returns the result of replacing each slash ('/') character in path with a separator character.
Glob: filepath.glob(pattern) returns the names of all files matching pattern or nil if there is no matching file.
IsAbs reports whether the path is absolute.
Join lua fileapth.join(path, ...) joins any number of path elements into a single path, adding a Separator if necessary.
ListSeparator lua filepath.list_separator() OS-specific path list separator.
Loader is the module loader function.
Match reports whether name matches the shell file name pattern.
Preload adds filepath to the given Lua state's package.preload table.
Rel returns a relative path.
Separator lua filepath.separator() OS-specific path separator.
Split splits path immediately following the final Separator, separating it into a directory and file name component.
No description provided by the author
ToSlash returns the result of replacing each separator character in path with a slash ('/') character.
VolumeName returns leading volume name.