Skip to content

Commit 935418c

Browse files
committed
use a temporary file that is erased on exit to store the string for
loading
1 parent 12db5fb commit 935418c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/org/mujoco/MuJoCoModelManager.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ public class MuJoCoModelManager {
3535
private HashMap<String, Double> setEfforts = new HashMap<String, Double>();
3636
private HashMap<String, Double> positions = new HashMap<String, Double>();
3737
public MuJoCoModelManager(String xml) throws IOException {
38-
//File tempFile = File.createTempFile("mujoco-", ".xml");
39-
//tempFile.deleteOnExit();
40-
File tempFile = new File("/tmp/mujocoxmlTEST.XML");
38+
File tempFile = File.createTempFile("mujoco-", ".xml");
39+
tempFile.deleteOnExit();
4140
Files.write( Paths.get(tempFile.getAbsolutePath()), xml.getBytes());
4241
loadFromFile(tempFile);
4342
}

0 commit comments

Comments
 (0)