将system2 stdout重定向到Windows上的文件

时间:2013-07-14 09:19:31

标签: r stdout cran devtools system2

根据manualstdout函数的system2参数可以将输出重定向到文件。这似乎适用于unix,但我不能让它在Windows上工作。下面的玩具示例中,未创建out.txterr.txt个文件。我尝试将其发送到现有文件,或者展开完整的文件路径,但没有成功:

setwd(tempdir())
system2("whoami", stdout="out.txt", stderr="err.txt")
file.exists("out.txt")

我做错了什么,或者这是system2中的限制?

1 个答案:

答案 0 :(得分:1)

我现在相信这是Windows中RGui.exe中的一个错误。我在这里提交了一个错误报告:https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15393