@@ -19,7 +19,8 @@ local M = {}
1919---
2020--- @param path string Input path.
2121--- @return string ? body File contents read in binary mode , or ` nil` on failure.
22- --- @return string ? err Error message when the check fails.
22+ --- @return string ? errmsg Error message when the check fails.
23+ --- @return integer ? errcode OS error code when available.
2324--- @nodiscard
2425function M .read_bytes (path ) end
2526
@@ -32,7 +33,8 @@ function M.read_bytes(path) end
3233---
3334--- @param path string Input path.
3435--- @return string ? body File contents read in text mode , or ` nil` on failure.
35- --- @return string ? err Error message when the check fails.
36+ --- @return string ? errmsg Error message when the check fails.
37+ --- @return integer ? errcode OS error code when available.
3638--- @nodiscard
3739function M .read_text (path ) end
3840
@@ -49,8 +51,9 @@ function M.read_text(path) end
4951---
5052--- @param path string Input path.
5153--- @param data string Input data.
52- --- @return boolean written ` true` when writing succeeds , ` false ` on failure.
53- --- @return string ? err Error message when the check fails.
54+ --- @return true ? written ` true` when writing succeeds , or ` nil` on failure.
55+ --- @return string ? errmsg Error message when the check fails.
56+ --- @return integer ? errcode OS error code when available.
5457function M .write_bytes (path , data ) end
5558
5659---
@@ -62,8 +65,9 @@ function M.write_bytes(path, data) end
6265---
6366--- @param path string Input path.
6467--- @param data string Input data.
65- --- @return boolean written ` true` when writing succeeds , ` false ` on failure.
66- --- @return string ? err Error message when the check fails.
68+ --- @return true ? written ` true` when writing succeeds , or ` nil` on failure.
69+ --- @return string ? errmsg Error message when the check fails.
70+ --- @return integer ? errcode OS error code when available.
6771function M .write_text (path , data ) end
6872
6973---
@@ -74,8 +78,9 @@ function M.write_text(path, data) end
7478--- ```
7579---
7680--- @param path string Input path.
77- --- @return boolean touched ` true` when the file exists after touch , ` false ` on failure.
78- --- @return string ? err Error message when the check fails.
81+ --- @return true ? touched ` true` when the file exists after touch , or ` nil` on failure.
82+ --- @return string ? errmsg Error message when the check fails.
83+ --- @return integer ? errcode OS error code when available.
7984function M .touch (path ) end
8085
8186---
@@ -90,8 +95,9 @@ function M.touch(path) end
9095---
9196--- @param oldname string Existing path.
9297--- @param newname string Replacement path.
93- --- @return boolean renamed ` true` when the rename succeeds , ` false ` on failure.
94- --- @return string ? err Error message when the check fails.
98+ --- @return true ? renamed ` true` when the rename succeeds , or ` nil` on failure.
99+ --- @return string ? errmsg Error message when the check fails.
100+ --- @return integer ? errcode OS error code when available.
95101function M .rename (oldname , newname ) end
96102
97103---
@@ -105,7 +111,7 @@ function M.rename(oldname, newname) end
105111--- @param path string Input path.
106112--- @param recursive ? boolean Remove a directory tree recursively when ` true` .
107113--- @return true ? removed ` true` when removal succeeds , or ` nil` on failure.
108- --- @return string ? err Error message when the check fails.
114+ --- @return string ? errmsg Error message when the check fails.
109115--- @return integer ? errcode OS error code when available.
110116function M .rm (path , recursive ) end
111117
@@ -122,7 +128,8 @@ function M.rm(path, recursive) end
122128---
123129--- @param path string Input path.
124130--- @return integer ? size File size in bytes.
125- --- @return string ? err Error message when the check fails.
131+ --- @return string ? errmsg Error message when the check fails.
132+ --- @return integer ? errcode OS error code when available.
126133--- @nodiscard
127134function M .getsize (path ) end
128135
@@ -135,7 +142,8 @@ function M.getsize(path) end
135142---
136143--- @param path string Input path.
137144--- @return number ? timestamp Access time (seconds since epoch ).
138- --- @return string ? err Error message when the check fails.
145+ --- @return string ? errmsg Error message when the check fails.
146+ --- @return integer ? errcode OS error code when available.
139147--- @nodiscard
140148function M .getatime (path ) end
141149
@@ -148,7 +156,8 @@ function M.getatime(path) end
148156---
149157--- @param path string Input path.
150158--- @return number ? timestamp Modification time (seconds since epoch ).
151- --- @return string ? err Error message when the check fails.
159+ --- @return string ? errmsg Error message when the check fails.
160+ --- @return integer ? errcode OS error code when available.
152161--- @nodiscard
153162function M .getmtime (path ) end
154163
@@ -161,7 +170,8 @@ function M.getmtime(path) end
161170---
162171--- @param path string Input path.
163172--- @return number ? timestamp Change time (seconds since epoch ).
164- --- @return string ? err Error message when the check fails.
173+ --- @return string ? errmsg Error message when the check fails.
174+ --- @return integer ? errcode OS error code when available.
165175--- @nodiscard
166176function M .getctime (path ) end
167177
@@ -174,7 +184,8 @@ function M.getctime(path) end
174184---
175185--- @param path string Input path.
176186--- @return LuaFileSystem.Attributes ? attrs Symlink-aware attributes , or ` nil` on failure.
177- --- @return string ? err Error message when the check fails.
187+ --- @return string ? errmsg Error message when the check fails.
188+ --- @return integer ? errcode OS error code when available.
178189--- @nodiscard
179190function M .lstat (path ) end
180191
@@ -187,7 +198,8 @@ function M.lstat(path) end
187198---
188199--- @param path string Input path.
189200--- @return string | integer | LuaFileSystem.AttributeMode | LuaFileSystem.Attributes ? attrs File attributes , or ` nil` on failure.
190- --- @return string ? err Error message when the check fails.
201+ --- @return string ? errmsg Error message when the check fails.
202+ --- @return integer ? errcode OS error code when available.
191203--- @nodiscard
192204function M .stat (path ) end
193205
@@ -201,7 +213,8 @@ function M.stat(path) end
201213--- @param path_a string Input path.
202214--- @param path_b string Input path.
203215--- @return boolean ? isSameFile True when both paths refer to the same file.
204- --- @return string ? err Error message when the check fails.
216+ --- @return string ? errmsg Error message when the check fails.
217+ --- @return integer ? errcode OS error code when available.
205218--- @nodiscard
206219function M .samefile (path_a , path_b ) end
207220
0 commit comments