lyng/docs/samples/fs_sample.lyng
sergeych 438e48959e - fixed bug in compiler (rare)
- added lyng.io.fs (multiplatform)
- CLI tools now have access to the filesystem
2025-11-29 00:51:01 +01:00

15 lines
321 B
Plaintext
Executable File

#!/bin/env lyng
import lyng.io.fs
import lyng.stdlib
val files = Path("../..").list().toList()
val longestNameLength = files.maxOf { it.name.length }
val format = "%-"+(longestNameLength+1) +"s %d"
for( f in files ) {
var name = f.name
if( f.isDirectory() ) name += "/"
println( format(name, f.size()) )
}