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:
@@ -0,0 +1,11 @@
|
||||
import "io" for File
|
||||
|
||||
var file = File.open("test/io/file/descriptor.wren")
|
||||
|
||||
// We can't test for a specific value since it's up to the OS, but it should be
|
||||
// a positive number.
|
||||
System.print(file.descriptor is Num) // expect: true
|
||||
System.print(file.descriptor > 0) // expect: true
|
||||
|
||||
file.close()
|
||||
System.print(file.descriptor) // expect: -1
|
||||
Reference in New Issue
Block a user