Hi everyone,
I'm reaching out regarding an issue I've encountered when trying to open R temp dir on Windows, similar to the one described in this Stack Overflow thread: Launching R Help - Error in file(out, "wt") : cannot open the connection.
In file(open = "w+b", encoding = "UTF-8") :
'C:/r_temp\RtmpgnMv59\Rf1510c48c31b70': No such file or directory
The error seems related to R's inability to create or write to temporary files after a long-running session. For context:
- This issue only occurs for me on Windows.
- I do not experience the same problem on Ubuntu.
- Reestablishing the R temp dir resolves the issue temporarily, but it’s not ideal for workflows with long-running R sessions, such as Plumber APIs or data pipelines.
I’m curious if others have encountered this and whether there are best practices for avoiding or mitigating it. Some questions I have:
- Are there settings or configurations for Windows that better manage temporary files for R? Especially when running multiple concurrent r processes.
- Would it help to periodically clean or reset the temporary directory within the session?
- Are there alternative approaches for handling long-running sessions where R Help might be used intermittently?
I would appreciate any insights or solutions others have implemented in similar scenarios.
Thank you!
Laurens