Hi,
I am working on an R package that I use to run various simulations on the cluster.
In that package, I define a temporary folder to create some files that I use and that I delete afterwards.
In order to create this temporary folder I use an R code very similar to:
# create temporary folders
working_folder = paste(tempdir(), stri_rand_strings(n=1,length = 16), sep = "/")
if (cleanup == F) {
message(paste("Working in", working_folder))
}
dir.create(working_folder, showWarnings = F, recursive = T)
where the function stri_rand_strings() is part of stringi R package and generates (pseudo)random strings of desired lengths.
Until very recently (roughly last week), the package was working perfectly fine in Yggdrasil and the function which use the code snippet above was creating a folder which was accessible and that I could access.
More precisely, the base R tempdir() function was returning a folder similar to:
> tempdir()
[1] "/tmp/RtmpjHYKkF"
However, now, the tempdir() function, when executed on the cluster returns something like:
> tempdir()
[1] "/scratch/RtmpoO7cYI"
which is not an accesible folder in the cluster.
Do you understand why the base R tempdir() function returns a non-accesible folder now and how we could counter this problem?
Just to be clear, the code works fine on a personnal computer and does provides a valid temporary folder that is accesible. It is just on the cluster that I observe the behavior described above, namely that tempdir()
produces a non valid path.
Many thanks in advance
Best
Lionel Voirol