Hilbish/emmyLuaDocs/fs.lua

55 lines
1.6 KiB
Lua
Raw Permalink Normal View History

2022-02-25 22:00:39 +00:00
--- @meta
local fs = {}
--- Returns an absolute version of the `path`.
--- This can be used to resolve short paths like `..` to `/home/user`.
2022-04-23 04:01:54 +00:00
function fs.abs(path) end
--- Returns the "basename," or the last part of the provided `path`. If path is empty,
--- `.` will be returned.
function fs.basename(path) end
2022-06-20 20:47:56 +00:00
--- Changes Hilbish's directory to `dir`.
2022-02-25 22:15:49 +00:00
function fs.cd(dir) end
2022-02-25 22:00:39 +00:00
--- Returns the directory part of `path`. If a file path like
--- `~/Documents/doc.txt` then this function will return `~/Documents`.
function fs.dir(path) end
2022-06-20 20:47:56 +00:00
--- Match all files based on the provided `pattern`.
--- For the syntax' refer to Go's filepath.Match function: https://pkg.go.dev/path/filepath#Match
---
---
function fs.glob(pattern) end
2022-06-20 20:47:56 +00:00
--- Takes any list of paths and joins them based on the operating system's path separator.
---
---
function fs.join(...path) end
2022-07-13 19:46:40 +00:00
--- Creates a new directory with the provided `name`.
--- With `recursive`, mkdir will create parent directories.
---
---
2022-02-25 22:15:49 +00:00
function fs.mkdir(name, recursive) end
2022-02-25 22:00:39 +00:00
--- Returns a pair of connected files, also known as a pipe.
--- The type returned is a Lua file, same as returned from `io` functions.
function fs.fpipe() end
--- Returns a list of all files and directories in the provided path.
function fs.readdir(path) end
2022-02-25 22:00:39 +00:00
--- Returns the information about a given `path`.
--- The returned table contains the following values:
2022-12-21 00:59:55 +00:00
--- name (string) - Name of the path
--- size (number) - Size of the path in bytes
--- mode (string) - Unix permission mode in an octal format string (with leading 0)
2022-12-21 00:59:55 +00:00
--- isDir (boolean) - If the path is a directory
---
---
2022-02-25 22:15:49 +00:00
function fs.stat(path) end
2022-02-25 22:00:39 +00:00
return fs