Begin work on os2/dir.odin

This commit is contained in:
gingerBill
2024-07-23 16:47:49 +01:00
parent 182454a1c0
commit 8037ace873
11 changed files with 286 additions and 49 deletions
+21
View File
@@ -0,0 +1,21 @@
package os2
import "base:runtime"
read_directory :: proc(f: ^File, n: int, allocator: runtime.Allocator) -> (fi: []File_Info, err: Error) {
return _read_directory(f, n, allocator)
}
read_all_directory :: proc(f: ^File, allocator: runtime.Allocator) -> (fi: []File_Info, err: Error) {
return read_directory(f, -1, allocator)
}
read_directory_by_path :: proc(path: string, n: int, allocator: runtime.Allocator) -> (fi: []File_Info, err: Error) {
f := open(path) or_return
defer close(f)
return read_directory(f, n, allocator)
}
read_all_directory_by_path :: proc(path: string, allocator: runtime.Allocator) -> (fi: []File_Info, err: Error) {
return read_directory_by_path(path, -1, allocator)
}