A locker is a directory structure where an enclosing folder contains subfolders that in turn contain the results of different simulation runs. When the number of simulation result sets is known, a stream of file names is returned. This function is mainly called by other functions; an exported function and documentation is provided in order to better communicate how the locker works.
setup_locker(where, tag = locker_tag(where))The locker location.
The directory that contains tagged directories of run results.
The name of a folder under where; this directory must not
exist the first time the locker is set up and will be deleted and
re-created each time it is used to store output from a new simulation run.
where must exist when setting up the locker. The directory tag will be
created under where and must not exist except if it had previously been
set up using setup_locker. Existing tag directories will have a
hidden file in them indicating that they are established simulation output
folders.
When recreating the tag directory, it will be unlinked and created new.
To not try to set up a locker directory that already contains outputs that
need to be preserved. You can call noreset_locker() on that directory
to prevent future resets.
reset_locker(), noreset_locker(), version_locker()
x <- setup_locker(tempdir(), tag = "my-sims")
x
Run the code above in your browser using DataLab