mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Updated posix/win32 stdlib namespacing
- Process stdlib - Fix to void expression blocks
This commit is contained in:
committed by
Christoffer Lerno
parent
5c9eb264e8
commit
ab93389031
16
resources/examples/process.c3
Normal file
16
resources/examples/process.c3
Normal file
@@ -0,0 +1,16 @@
|
||||
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");
|
||||
}
|
||||
Reference in New Issue
Block a user