Cosmo/examples/reader.cosmo
CPunch 4de274d760 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"))
```
2023-09-05 14:38:24 -05:00

10 lines
142 B
Plaintext

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"))