New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rmarkdown creates _files directory not cleared #1553
Comments
|
Is there any update on this issue? |
|
It is normal for Markdown to create the empty "_files" directory, but it usually cleans up after itself. We sometimes see it left behind when a knit fails; for example, when our students attempt to knit an Rmd with Plotly figures to PDF. Side note: These left-behind "_files" directories can be a real PITA in a collaborative, multi-user environment, since they usually are set with write access only for the user who generated them (RStudio Server doesn't set write for the group). This is not a "bug" per se, since RStudio Server is basically doing the right thing from a security standpoint... |
|
The "_files" directory is not cleaned up after knit and knit does not fail (i.e. the pdf has been generated successfully). Is there any command to force Rstudio to clean it up? |
|
This is definitely new behaviour in v1.12. I just looked at the recent changes in the if (output_format$clean_supporting && !dir_exists(cache_dir)) intermediates <- c(
intermediates, if (identical(list.files(files_dir, '^figure-.+'), files_dir_fig)) {
files_dir
} else knitr::opts_chunk$get('fig.path')
)This is a new evaluation of the intermediate directories compard to v1.11: if (output_format$clean_supporting && !dir_exists(cache_dir))
intermediates <- c(intermediates, files_dir)The difference between the two versions is the inclusion of files_dir_fig <- list.files(files_dir, '^figure-.+') # existing figure dir(s)Because the |
|
If I label an issue as "Bug", usually it means I have confirmed that it is a real bug, and will be fixed. If I also assign it to a milestone, it means it is important and should be fixed in the next version. Thanks for your patience! |
|
The fix isn't passed on to |
|
Can you open a new issue with a reproductible example on how it worked before and how it works now ? |
|
@dchiu911 Judging from the directory name |
|
Thanks very much. |
|
Yes, you can install the development version via remotes::install_github('rstudio/rmarkdown') |
|
@yihui if by design, not a bug, thanks. |
|
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
Hello,
I was playing with rmarkdown::render() function. After that, I found knit in rmarkdown always created an empty "_files" directory, which I do not want. Is there any commands that can help me get rid of this directory automatically? I have attached the all the render commands I have tried.
In my case, it always created 6_1p_CSC05a_onset_files folder in the same folder as 6_1p_CSC05a_onset.pdf. Any help would be appreciated!
The text was updated successfully, but these errors were encountered: