Files
c3c/resources/examples/process.c3
Christoffer Lerno ab93389031 - Updated posix/win32 stdlib namespacing
- Process stdlib
- Fix to void expression blocks
2023-06-21 16:27:53 +02:00

17 lines
345 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().as_stream();
while (try char b = stream.read_byte())
{
io::printf("%c", b);
}
io::printn("...Done");
}