Commit Graph

22 Commits

Author SHA1 Message Date
5d98d20175 Add Stdin.isRaw. 2016-05-20 15:19:18 -07:00
1e4b9e5175 File.realPath().
Not tested yet, because we can't create symlinks from Wren and I don't
want to check symlinks into the repo, but it seems to do the right
thing.
2016-02-27 15:53:02 -08:00
60162575ee More file system checking functions:
- Stat#isFile
- Stat#isDirectory
- Directory.exists()
- File.exists()
2016-02-21 12:23:33 -08:00
c6148f8941 Make Stat a foreign class.
Instead of copying the uv_fs_stat struct to a list of Wren numbers, we
store it directly in the Stat object. This is important because we'll
need to implement later methods like isDirectory() in C so we can use
S_ISDIR(). For that, we need to have access to the original stat data.
2016-02-21 11:34:10 -08:00
b331915259 Add stat instance method to File. 2016-02-21 10:18:45 -08:00
8e90e3577b More file IO!
Can now create, delete, and write to files.
2016-02-20 09:23:42 -08:00
79558d95e5 Move File.stat() -> Stat.path().
Thanks, Michel!
2016-02-07 09:56:16 -08:00
71e2458a6c Add API for accessing command-line arguments.
- Add process module with Process class.
- Add "arguments" and "allArguments" methods.
- Docs for same.
- Support passing additional arguments to command line.
- Add "--help" support to command line.
2016-01-22 07:57:26 -08:00
5cd8a06fa0 File.stat(). 2016-01-01 09:58:44 -08:00
b054526df8 Add an optional offset to File.readBytes(). 2015-12-30 08:13:19 -08:00
678251a00c Fix type for fileFinalizer(). 2015-12-29 21:07:26 -08:00
ed6fad6153 Get rid of fiber for finalizers.
Instead, finalizers just get access to the foreign object's raw bytes.
This is deliberately limiting, since it discourages the user from
interacting with the VM in the middle of a GC.
2015-12-28 08:06:29 -08:00
0ac793d4f8 Add Directory.list() to io. 2015-12-24 10:12:12 -08:00
69a5c1d017 Avoid empty array initializer which seems to be problematic on VC++. 2015-11-25 08:36:42 -08:00
aaab14959f Get rid of extraneous "," in module macros.
Thanks, Michel!
2015-11-10 07:13:19 -08:00
e5176607d9 Move meta and random to "aux" modules.
Wren now has three classes of modules:

- The one magic "core" module that's built in and always needed.
- Auxiliary libraries like "meta" and "random". These do not have any
  dependencies, so can be used even when you embed Wren inside an
  application. But they're also optional and can be disabled if you
  don't need them.
- CLI modules. These ones need libuv and are tied to the CLI wrapper
  around the VM.
2015-10-17 22:09:48 -07:00
8436ce1934 Add a random module. 2015-10-17 11:03:15 -07:00
d431c2eaa8 Start sketching in support for reading from stdin. 2015-10-16 21:05:24 -07:00
b7ed774da3 Reading files!
- File.close()
- File.open()
- File.read()
- file.readBytes()

And a few other little methods. Still lots more work to do, but it's a
start.
2015-09-30 21:13:36 -07:00
f6083b1756 Simplify how built-in foreign methods and classes are wired up. 2015-09-21 07:58:39 -07:00
dc527c8d86 Add "io" module with beginnings of a File class. 2015-09-16 07:34:49 -07:00
ea5c3b01eb Add module for Scheduler.
Also reorganizes some code to make it easier to add more modules.
2015-09-13 11:32:39 -07:00