Lessons

lesson 12 / 15

Writing virtual files

write replaces a file and append adds to a file. Their exact destination depends on the embedding project.

In this browser course, writes go to an in-memory virtual filesystem. The cell shows the files written after it runs; no file is created on your computer.

kongue
main {
    write "report.txt" "first line"
    append "report.txt" "\nsecond line"
}

This same script embedded in kpkg can write into a package or build root instead. The language describes the operation; the host project decides how the operation is handled.