johnmchambers / XRJulia

XR-style Interface to Julia (from "Extending R")
33 stars 2 forks source link

asRObject() cannot erase temp files on Windows #23

Closed oliviaAB closed 5 years ago

oliviaAB commented 5 years ago

Hi,

I have been using XRJulia on Windows. If I run:

bigvector = juliaGet(juliaEval("collect(1:100000)"))

I get the following warning:

/Rtools/bin/rm: cannot remove '[TMPDIR]\Rtmp8uV2Db\Julia25502a4466b5_212': Device or resource busy

I tried to track down the cause of the warning, and it turns out the asRObject method defined for vector_R_direct tries to erase the file containing the value (l.803 of RJuliaConnect.R):

on.exit(base::system(paste("rm ",object@file)))

Which is impossible because the file is used by the Julia process. It happened on 2 different Windows computers, but not in Linux. Is there a way to bypass the warning and force the rm?

Thanks!