Skip to content
Prev 18241 / 398513 Next

How to detach binary objects/libraries?

On 25 Mar 2002, Peter Dimitrov wrote:

            
No, it is to follow the example I pointed you too.  You need code like

.Last.lib <- function(libpath) {
    if(is.loaded(symbol.C("tcltk_end"))) {
        .C("tcltk_end", PACKAGE="tcltk")
        dyn.unload(file.path(libpath, "libs", "tcltk.dll"))
        num <- match("tcltk", get(".Dyn.libs", envir = NULL))
        assign(".Dyn.libs",
               get(".Dyn.libs", envir = NULL)[-num],
               envir = NULL)
    }
}
But my point was: what does changing the file copy of an already loaded
shared library do?   It's not allowed on Windows, and on Solaris it will
lead to a crash.  I don't know about Linux, as I would never try it
given my experience.