cannot mkdir R_TempDir (não é possível criar um diretório em R_TempDir)

I’m constantly using rJava/JRI for a large amount of simulations. Repently it was not working anymore, and since I’d not change anything in the main code, it was a quite weird behavior. My rJava binding looks like this and the first line was the only being executed:

System.out.println("Creating Rengine (with arguments)");
re = new Rengine(args.split(" "), false, null);
if (!re.waitForR()) {
System.out.println("Cannot load R");
System.out.println("R loaded");

That was awkward so I tried to use R in the console. When I execute the “R” command I received “cannot mkdir R_TempDir”. So I dug into the R source code to know when it happens. So I figured out that R tries to read environment variables TMPDIR, TMP, and TEMP before set “/tmp” as default one. Since this variables were not set, the “/tmp” is the destiny of the temporary stuff.

When I saw my “/tmp” directory was full, I mean, filled with the maximum number of directories possible in an Ext3 File System, 32K. I realized that all the problem was that R was not getting space for the new “Rtmp…” directories.

To solve that, “rmdir Rtmp*” inside “/tmp” dir. And the world is a happy place again.