Add "io" module with beginnings of a File class.

This commit is contained in:
Bob Nystrom
2015-09-16 07:34:49 -07:00
parent 251752fcfb
commit dc527c8d86
10 changed files with 143 additions and 2 deletions
+18
View File
@@ -0,0 +1,18 @@
import "io" for File
import "scheduler" for Scheduler
System.print(File.size("test/io/file/size.wren")) // expect: 401
// Runs asynchronously.
Scheduler.add {
System.print("async")
}
System.print(File.size("test/io/file/size.wren"))
// expect: async
// expect: 401
var error = Fiber.new {
System.print(File.size("nonexistent"))
}.try()
System.print(error) // expect: no such file or directory