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

tempfile() uses a random hex to generate an unlikely existing file name #1

Open
dchiu911 opened this issue Dec 22, 2021 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@dchiu911
Copy link
Member

Instead of using tempdir() here, another robust alternative can be done using tempfile()

tempfile(pattern = "ocv-temp", fileext = ".sqlite")
#> [1] "/var/folders/7m/vs2l36sd0yl0d7p7mddnhc280000gp/T//Rtmp9hBCOI/ocv-temp67e27dca8d6f.sqlite"
tempfile(pattern = "ocv-temp", fileext = ".sqlite")
#> [1] "/var/folders/7m/vs2l36sd0yl0d7p7mddnhc280000gp/T//Rtmp9hBCOI/ocv-temp67e27d0bb2ed.sqlite"
tempfile(pattern = "ocv-temp", fileext = ".sqlite")
#> [1] "/var/folders/7m/vs2l36sd0yl0d7p7mddnhc280000gp/T//Rtmp9hBCOI/ocv-temp67e2b1025be.sqlite"

Created on 2021-12-21 by the reprex package (v2.0.1)

@dchiu911 dchiu911 added the enhancement New feature or request label Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants