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.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import "io" for File
|
||||
import "scheduler" for Scheduler
|
||||
|
||||
System.print(File.size("test/io/file/size.wren")) // expect: 401
|
||||
System.print(File.size("test/io/file/size.wren")) // expect: 270
|
||||
|
||||
// Runs asynchronously.
|
||||
Scheduler.add {
|
||||
@@ -10,9 +10,4 @@ Scheduler.add {
|
||||
|
||||
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
|
||||
// expect: 270
|
||||
|
||||
Reference in New Issue
Block a user