Return paths to files or dirs within the temp dir

Share:

Description

Vectorized wrappers to tempdir and tempfile that return standardized paths.

Usage

1
2
3
temp_dir(..., sep = c("/", "\\"))

temp_file(..., pattern = "file", fileext = "", sep = c("/", "\\"))

Arguments

...

Character vectors of further directories within the temp directory. Passed to file.path.

sep

String separator between directory levels in the output.

pattern

Character vector of prefixes for the temp file name. Passed to tempfile.

fileext

Character vector of file extensions for the temp file. Passed to tempfile.

Value

For temp_file a character vector giving the names of possible (temporary) files. Note that no files are generated by temp_file. For temp_dir, the path of the per-session temporary directory.

See Also

tempdir

Examples

1
2
temp_dir(c("foo", "bar/baz"))
temp_file(c("foo", "bar/baz"), fileext = c(".txt", ".R"))