stdio重定向问题
#4527
-
add_rules("mode.debug", "mode.release")
target("main")
set_kind("binary")
add_files("src/*.cpp")
set_toolchains("clang")
set_languages("cxx20")
on_run(function(target)
os.execv(target:targetfile(), {}, {stdin = "input.txt"})
end) 我执行execv时重定向了输入,但是运行程序时不会输出到终端? |
Beta Was this translation helpful? Give feedback.
Answered by
waruqi
Dec 21, 2023
Replies: 2 comments 4 replies
-
会输出 xmake> os.execv("echo", {"hello"}, {stdin = "/tmp/a"})
hello |
Beta Was this translation helpful? Give feedback.
4 replies
-
我开了个 issues 先备着,后面如果有时间可以再细看下。。#4546 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
win 下才有的问题,这个地方导致 https://github.com/tboox/tbox/blob/059f19ed8f18cfcd59c1ca2f2aff3143157a0df4/src/tbox/platform/windows/process.c#L489
但是目前没有很好的办法解决,这块涉及很多细节东西 #3138 (comment)