mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +01:00
Test File.stat() on a directory.
This commit is contained in:
@ -35,6 +35,13 @@ whatever encoding the file uses.
|
||||
|
||||
Returns the size in bytes of the contents of the file at `path`.
|
||||
|
||||
### File.**stat**(path)
|
||||
|
||||
"Stats" the file or directory at `path`. Returns a [Stat][] object describing
|
||||
the low-level details of the file system entry.
|
||||
|
||||
[stat]: stat.html
|
||||
|
||||
## Constructors
|
||||
|
||||
### File.**open**(path)
|
||||
|
||||
16
test/io/file/stat_static_directory.wren
Normal file
16
test/io/file/stat_static_directory.wren
Normal file
@ -0,0 +1,16 @@
|
||||
import "io" for File, Stat
|
||||
import "scheduler" for Scheduler
|
||||
|
||||
var stat = File.stat("test/io/directory/dir")
|
||||
|
||||
System.print(stat is Stat) // expect: true
|
||||
System.print(stat.device is Num) // expect: true
|
||||
System.print(stat.inode is Num) // expect: true
|
||||
System.print(stat.mode is Num) // expect: true
|
||||
System.print(stat.linkCount) // expect: 5
|
||||
System.print(stat.user is Num) // expect: true
|
||||
System.print(stat.group is Num) // expect: true
|
||||
System.print(stat.specialDevice) // expect: 0
|
||||
System.print(stat.size) // expect: 170
|
||||
System.print(stat.blockSize is Num) // expect: true
|
||||
System.print(stat.blockCount is Num) // expect: true
|
||||
Reference in New Issue
Block a user