Merge branch 'master' into api

# Conflicts:
#	src/module/io.c
This commit is contained in:
Bob Nystrom
2015-12-26 20:42:53 -08:00
17 changed files with 175 additions and 41 deletions

View File

@ -0,0 +1 @@
this is a text file

View File

@ -0,0 +1 @@
this is a text file

View File

@ -0,0 +1 @@
this is a text file

View File

@ -0,0 +1,8 @@
import "io" for Directory
var entries = Directory.list("test/io/directory/dir")
// Ignore OS-specific dot files like ".DS_Store".
entries = entries.where {|entry| !entry.startsWith(".") }.toList
System.print(entries) // expect: [a.txt, b.txt, c.txt]

View File

@ -0,0 +1,3 @@
import "io" for Directory
var entries = Directory.list("test/io/directory/dir/a.txt") // expect runtime error: not a directory

View File

@ -0,0 +1,3 @@
import "io" for Directory
Directory.list("nonexistent") // expect runtime error: no such file or directory

View File

@ -0,0 +1,3 @@
import "io" for Directory
Directory.list(123) // expect runtime error: Path must be a string.