checking for detritus in the temp directory ... NOTE #59
Replies: 3 comments
-
This one looks fine to me. Probably worth mentioning |
Beta Was this translation helpful? Give feedback.
-
@aitap Thanks for this recipe! Please go ahead and add this as a PR. Here is the template guide to re-format your contribution: https://github.com/r-devel/cran-cookbook/wiki/Contributors-Guide#recipe-template- |
Beta Was this translation helpful? Give feedback.
-
Resolved in #69. |
Beta Was this translation helpful? Give feedback.
-
Related to Writing Files and Directories to the Home Filespace.
Problem: your package got a
NOTE
complaining about the "detritus in the temp directory".Cause: some of the code that runs as a result of
R CMD check
creates files in the temporary directory specified by the environment variableTMPDIR
and doesn't remove them afterwards. This may include your own tests creating files under tempdir(), child processes, or Python code launched usingreticulate
.Solution: if you use
tempfile()
/tempdir()
as the default destination for functions called in your examples or tests,unlink()
the resulting files as part of the test. In\examples{}
, clean-up actions can be wrapped in\dontshow{}
for aesthetic reasons. If you launch a browser, Calibre, or Python code, and it creates temporary files, find out what they are and remove them once the launched code is done with them. For example, R packages that use thetensorflow
Python package find and remove temporary files created by its auto-gradient feature.Beta Was this translation helpful? Give feedback.
All reactions