-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathfile.lua
More file actions
52 lines (43 loc) · 1.07 KB
/
file.lua
File metadata and controls
52 lines (43 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---@meta soluna.file
---
--- Soluna file module
---
---@class soluna.file
local file = {}
---
--- Loads a file's contents
---
---@param filename string File path
---@return string? content File contents or nil on error
function file.load(filename) end
---
--- Gets file attributes
---
---@param filename string File path
---@return table? attributes File attributes or nil
function file.attributes(filename) end
---
--- Checks if a file exists
---
---@param filename string File path
---@return boolean? exists True if file exists, nil if not
function file.exist(filename) end
---
--- Checks if a local file exists
---
---@param filename string File path
---@return boolean? exists True if file exists, nil if not
function file.local_exist(filename) end
---
--- Loads a local file's contents
---
---@param filename string File path
---@return string? content File contents or nil
function file.local_load(filename) end
---
--- Iterates over directory entries
---
---@param path string Directory path
---@return function iterator Iterator function
function file.dir(path) end
return file