gpt4 book ai didi

将 system2 标准输出重定向到 Windows 上的文件

转载 作者:行者123 更新时间:2023-12-04 19:50:00 25 4
gpt4 key购买 nike

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

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

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

最佳答案

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

关于将 system2 标准输出重定向到 Windows 上的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17638090/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com