1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

examples: Process examples (#8598)

This commit is contained in:
kristof de spiegeleer
2021-02-07 05:19:05 +01:00
committed by GitHub
parent 68b4051a6e
commit 2d875260e8
7 changed files with 209 additions and 2 deletions

21
examples/process/execve.v Normal file
View File

@@ -0,0 +1,21 @@
module main
import os
fn exec(args []string) {
mut out := ''
mut line := ''
mut line_err := ''
os.execve('/bin/bash', args, []) or {
// eprintln(err)
panic(err)
}
}
fn main() {
// exec(["-c","find /"]) //works
exec(['-c', 'find /tmp/']) // here it works as well
// exec(["-c","find","/tmp/"]) // does not work I guess is normal
}