~mrms/osum

OS library for Umka
change .build.yml
Fix string corruption bug

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~mrms/osum
read/write
git@git.sr.ht:~mrms/osum

You can also use your local clone with git send-email.

#os.um

An OS operation library for Umka. Download using PAK.

#Example

import (
        "pak/os/os.um"
)

fn main() {
        // Make a directory
        os.mkdir("test")

        // Test a file
        printf("isfile(\"test\")   = %v\n", os.isfile("test"))
        printf("isdir(\"test\")    = %v\n", os.isdir("test"))

        // Recursively walk through a directory
        printf("Walk dir:\n")
        if errno := os.walk(".", fn(file: str) {
                printf("\t%v\n", file)
        }); errno != 0 {
                printf("walk failed: %v\n", os.strerror(errno))
        }

        // Remove a directory (not recursive)
        if errno := os.remove("test"); errno != 0 {
                printf("rmfile failed: %v\n", os.strerror(errno))
        }
}

#License

Unlicense/MIT