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
|
|
|
|
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
|
2022-12-04 02:50:15 +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-04 02:50:15 +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-04 02:50:15 +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).
|
2022-12-04 02:50:15 +00:00
|
|
|
function fs.join(paths...) 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
|
|
|
|
|
|
|
--- 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
|
|
|
|
|
|
|
--- Returns info about `path`
|
2022-02-25 22:15:49 +00:00
|
|
|
--- @param path string
|
|
|
|
function fs.stat(path) end
|
2022-02-25 22:00:39 +00:00
|
|
|
|
|
|
|
return fs
|