Skip to content

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

Open
@dchiu911

Description

@dchiu911

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)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions