More file system checking functions:
- Stat#isFile - Stat#isDirectory - Directory.exists() - File.exists()
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
import "io" for Stat
|
||||
|
||||
System.print(Stat.path("test/io/file/file.txt").isDirectory) // expect: false
|
||||
System.print(Stat.path("test").isDirectory) // expect: true
|
||||
@@ -0,0 +1,4 @@
|
||||
import "io" for Stat
|
||||
|
||||
System.print(Stat.path("test/io/file/file.txt").isFile) // expect: true
|
||||
System.print(Stat.path("test").isFile) // expect: false
|
||||
@@ -1,5 +1,4 @@
|
||||
import "io" for Stat
|
||||
import "scheduler" for Scheduler
|
||||
|
||||
var stat = Stat.path("test/io/file/file.txt")
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import "io" for Stat
|
||||
import "scheduler" for Scheduler
|
||||
|
||||
var stat = Stat.path("test/io/directory/dir")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user