library.dynam
Loading DLLs from Packages

Description

Dynamically load or unload DLLs from packages.

Usage

library.dynam(chname, package = NULL, lib.loc = NULL, 
   verbose = getOption("verbose"), 
   file.ext = .Platform$dynlib.ext, ...)
library.dynam.unload(chname, libpath, verbose = getOption("verbose"), 
   file.ext = .Platform$dynlib.ext)
.dynLibs(new)

Arguments

chname a character string specifying the DLL name to load or unload.
package a character vector giving the name of packages.
lib.loc a character vector containing the names of library directories to search.
verbose a logical value. If TRUE, warning messages are displayed in some cases. The default value is the value of option "verbose".
file.ext a character string giving the file extension (including the "." character). The default is platform dependent: ".dll" for Windows, and ".so" or ".sl" for UNIX platforms.
... other optional arguments pass to dyn.load().
libpath the library path for the DLL to unload.
new a list of "DLLInfo" objects, with class "DLLInfoList".

Details

Value

library.dynamIf chname is missing or an empty string, returns a list object with class "DLLInfoList" and each element is a "DLLInfo" object. Otherwise, returns the loaded "DLLInfo" object invisibly.
library.dynam.unloadreturns the unloaded "DLLInfo" object invisibly.
.dynLibsreturns nothing if new is specified. Otherwise, returns a list object with class "DLLInfoList" and each element is a "DLLInfo" object.
Differences between TIBCO Enterprise Runtime for R and Open-source R
In open-source R, .dynLibs is used to set the internal list of "DLLInfo" objects, which is an object with class "DLLInfoList", if new is specified. Otherwise, it just returns this internal list if new is missing.
In TIBCO Enterprise Runtime for R, .dynLibs is equivalent to getLoadedDLLs, except the DLLInfoList structure it returns carries no names. The new parameter is ingored.
Note
Use library.dynam.unload instead of dyn.unload to unload the DLLs that have been loaded through library.dynam.
References
Becker, R. A., Chambers, J. M., and Wilks, A. R. 1988. The New S Language. Pacific Grove, CA: Wadsworth & Brooks/Cole Advanced Books and Software.
See Also
getLoadedDLLs , dyn.load
Examples

identical(library.dynam(), .dynLibs()) # TRUE library.dynam("stats", verbose = TRUE) library.dynam("FOO", package = "FOO") # Error library.dynam("MASS", package = "MASS", verbose = TRUE) ## Not run: # This example only runs in R. library.dynam.unload("MASS", file.path(Sys.getenv("R_HOME"), "library/MASS"), verbose = TRUE) ## End(Not run)

Package base version 6.0.0-69
Package Index