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,13 @@
|
||||
import "io" for File
|
||||
|
||||
var file = File.open("test/io/file/file.txt")
|
||||
|
||||
System.print(file.readBytes(3)) // expect: thi
|
||||
|
||||
// Always reads from the beginning.
|
||||
System.print(file.readBytes(7)) // expect: this is
|
||||
|
||||
// Allows zero.
|
||||
System.print(file.readBytes(0).bytes.count) // expect: 0
|
||||
|
||||
file.close()
|
||||
Reference in New Issue
Block a user