added os.open(); new file object

eg.
```lua
local err, file = os.open("LICENSE.md")
if err then
    // do error handling stuff
end

// passing "a" to read() will read the whole file
print(file:read("a"))
```
This commit is contained in:
2023-09-05 14:38:24 -05:00
committed by cpunch
parent bf36412699
commit b3587f48a2
3 changed files with 152 additions and 42 deletions

9
examples/reader.cosmo Normal file
View File

@@ -0,0 +1,9 @@
local err, file = os.open("LICENSE.md")
print("made file")
if err then
print("failed to open file")
end
print(file)
print(file:read("a"))