Files
c3c/resources/examples/process.c3
Christoffer Lerno 9a6d83f526 Updated stream API.
2023-09-03 01:14:15 +02:00

17 lines
336 B
C

module test;
import std::os::process;
import std::io;
fn void! main()
{
String command = env::WIN32 ? "dir" : "ls";
SubProcess x = process::create({ command }, { .search_user_path = true })!!;
x.join()!;
Stream* stream = &&x.stdout();
while (try char b = stream.read_byte())
{
io::printf("%c", b);
}
io::printn("...Done");
}