Add or update the directory location for items in a file_stream object.
If a directory path already exists, it is removed first.
Arguments
- x
A
file_streamobject.- where
The new location.
- initialize
If
TRUE, then thewheredirectory is passed to a call toreset_locker().- ask
If
TRUE, thenconfig_locker()will be called on the locker space; once this is called, all future attempts to reset the locker contents will require user confirmation viautils::askYesNo(); theaskrequirement can be revoked by callingconfig_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"