mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-06-24 18:30:05 +00:00
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:
@@ -3,6 +3,13 @@
|
||||
|
||||
#include "cstate.h"
|
||||
|
||||
enum
|
||||
{
|
||||
COSMO_USER_NONE, // CObjObject is not a userdata object
|
||||
COSMO_USER_FILE, // CObjObject is a file object (see cosmoB_osOpen)
|
||||
COSMO_USER_START // the first user type for user-defined userdata
|
||||
};
|
||||
|
||||
/* loads all of the base library, including:
|
||||
- base library ("print", "assert", "type", "pcall", "loadstring", etc.)
|
||||
- object library
|
||||
|
||||
Reference in New Issue
Block a user