Skip to contents

Add or update the directory location for items in a file_stream object. If a directory path already exists, it is removed first.

Usage

locate_stream(x, where, initialize = FALSE, ask = FALSE)

Arguments

x

A file_stream object.

where

The new location.

initialize

If TRUE, then the where directory is passed to a call to reset_locker().

ask

If TRUE, then config_locker() will be called on the locker space; once this is called, all future attempts to reset the locker contents will require user confirmation via utils::askYesNo(); the ask requirement can be revoked by calling config_locker().

Details

When initialize is set to TRUE, the locker space is initialized or reset. In order to initialize, where must not exist or it must have been previously set up as locker space. See setup_locker() for details.

Examples

x <- new_stream(5)
x <- locate_stream(x, file.path(tempdir(), "foo"))
x[[1]]$file
#> [1] "/var/folders/5w/2ky5lwcj1zq7kyk4c3zg3zpw0000gp/T//Rtmpx1IZit/foo/1-5"