Skip to content
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

devtools::document() tries to delete the sink file without closing the connection #2351

Closed
pehaugedal opened this issue May 6, 2021 · 0 comments

Comments

@pehaugedal
Copy link

When using devtools::document() with quiet = TRUE the function tries to delete the sink file it creates without closing the connection first. This results in the following error:

Error: [EBUSY] Failed to remove 'C:/Users/username/AppData/Local/Temp/RtmpeeJrTl/file23022c94c04': resource busy or locked

The file in question is created in the following code block, and is set to delete when the function exits:

if (quiet) {
    output <- file_temp()
    on.exit(file_delete(output))
    withr::local_output_sink(output)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant