2022-02-25 22:00:39 +00:00
|
|
|
--- @meta
|
|
|
|
|
|
|
|
local fs = {}
|
|
|
|
|
2022-04-23 04:01:54 +00:00
|
|
|
--- Gives an absolute version of `path`.
|
|
|
|
--- @param path string
|
2023-02-07 22:19:24 +00:00
|
|
|
--- @returns string
|
2022-04-23 04:01:54 +00:00
|
|
|
function fs.abs(path) end
|
|
|
|
|
2022-06-20 20:47:56 +00:00
|
|
|
--- Gives the basename of `path`. For the rules,
|
|
|
|
--- see Go's filepath.Base
|
2023-02-07 22:19:24 +00:00
|
|
|
--- @returns string
|
2022-12-15 04:00:54 +00:00
|
|
|
function fs.basename(path) end
|
2022-06-20 20:47:56 +00:00
|
|
|
|
2022-02-25 22:00:39 +00:00
|
|
|
--- Changes directory to `dir`
|
2022-02-25 22:15:49 +00:00
|
|
|
--- @param dir string
|
|
|
|
function fs.cd(dir) end
|
2022-02-25 22:00:39 +00:00
|
|
|
|
2022-06-20 20:47:56 +00:00
|
|
|
--- Returns the directory part of `path`. For the rules, see Go's
|
|
|
|
--- filepath.Dir
|
2022-12-21 00:59:55 +00:00
|
|
|
--- @param path string
|
2023-02-07 22:19:24 +00:00
|
|
|
--- @returns string
|
2022-12-15 04:00:54 +00:00
|
|
|
function fs.dir(path) end
|
2022-06-20 20:47:56 +00:00
|
|
|
|
|
|
|
--- Glob all files and directories that match the pattern.
|
|
|
|
--- For the rules, see Go's filepath.Glob
|
2022-12-21 00:59:55 +00:00
|
|
|
--- @param pattern string
|
2023-02-07 22:19:24 +00:00
|
|
|
--- @returns table
|
2022-12-15 04:00:54 +00:00
|
|
|
function fs.glob(pattern) end
|
2022-06-20 20:47:56 +00:00
|
|
|
|
2022-07-13 19:46:40 +00:00
|
|
|
--- Takes paths and joins them together with the OS's
|
|
|
|
--- directory separator (forward or backward slash).
|
2023-02-07 22:19:24 +00:00
|
|
|
--- @vararg string
|
|
|
|
--- @returns string
|
2022-12-21 00:59:55 +00:00
|
|
|
function fs.join(...) end
|
2022-07-13 19:46:40 +00:00
|
|
|
|
2022-02-25 22:00:39 +00:00
|
|
|
--- Makes a directory called `name`. If `recursive` is true, it will create its parent directories.
|
2022-02-25 22:15:49 +00:00
|
|
|
--- @param name string
|
2022-02-25 22:17:22 +00:00
|
|
|
--- @param recursive boolean
|
2022-02-25 22:15:49 +00:00
|
|
|
function fs.mkdir(name, recursive) end
|
2022-02-25 22:00:39 +00:00
|
|
|
|
2022-12-21 00:59:55 +00:00
|
|
|
--- Returns a table of files in `dir`.
|
2022-02-25 22:15:49 +00:00
|
|
|
--- @param dir string
|
|
|
|
--- @return table
|
|
|
|
function fs.readdir(dir) end
|
2022-02-25 22:00:39 +00:00
|
|
|
|
2022-12-21 00:59:55 +00:00
|
|
|
--- Returns a table of info about the `path`.
|
|
|
|
--- It contains the following keys:
|
|
|
|
--- name (string) - Name of the path
|
|
|
|
--- size (number) - Size of the path
|
|
|
|
--- mode (string) - Permission mode in an octal format string (with leading 0)
|
|
|
|
--- isDir (boolean) - If the path is a directory
|
2022-02-25 22:15:49 +00:00
|
|
|
--- @param path string
|
2022-12-21 00:59:55 +00:00
|
|
|
--- @returns table
|
2022-02-25 22:15:49 +00:00
|
|
|
function fs.stat(path) end
|
2022-02-25 22:00:39 +00:00
|
|
|
|
|
|
|
return fs
|