Synchronize Datasets

DESCRIPTION:
Forces consistency between the evaluator and the data directories, frame 0, etc. This occurs immediately rather than at the end of the current expression.

USAGE:
synchronize(database=<<see below>>)

OPTIONAL ARGUMENTS:
database:
numeric vector of the positions in the search list that should be updated.

SIDE EFFECTS:
The internal contents of the evaluator are made consistent with the databases specified by database. This takes place immediately, not at completion of the current expression.

When database is given, these (and only these) databases will be detached and re-attached, so that their dictionaries reflect any changes made to the external directory or whatever defines the database. If database is not provided, all databases are flushed, so that pending assignments, etc. are committed, but the dictionaries are not revised.


DETAILS:
There are two situations in which synchronize is needed. If you are doing a long computation iteratively and want to ensure that permanent assignments will be committed now, regardless of any error you may make in the future, synchronize() does that. On the other hand, if you know or suspect that some other process than your own S-PLUS session may have modified some object that could be in the keep table (for example, if you edit a function in one window that you are using in another), then synchronize(1) is needed, in the case that the revised data is on the working database.

To be precise, the second use is only required either to tell the evaluator that the names of the objects have changed or to update an object, like a function definition, that will have been saved in the database. But if you are in doubt and some other process has changed something on database n, it's wise to call synchronize(n).


SEE ALSO:
assign , Assignment .

EXAMPLES:
# select datasets to remove, do it now
remove.now <- function(now=TRUE)
{
        cat("Type in some datasets to remove:\n")
        name <- scan(what="")
        remove(name, where=1)
        if(now) synchronize()
}