We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey there,
I have a large amount of images named 001.jpg, 002.jpg etc etc. Each number is associated to a name Klaus, Günther etc etc.. I am using Processing to load the images, find out the associated name and try to rename the file to Klaus.jpg, Günther.jpg etc etc.
I am using open() to change the filename, using the following command: mv 'path/to/image/001.jpg' 'path/to/image/Klaus.jpg'
In Processing splitted into a String Array, because you have to!?
But the filenames just dont change!! Also trying Runtime.getRuntime.exec() is not working.
Is there maybe some limitations of what kind of commands one can execute from Processing?
Answers
Perhaps you should try File class and its renameTo() method? :-??
http://docs.oracle.com/javase/8/docs/api/java/io/File.html#renameTo-java.io.File-
There's also move() method from Files class: 8-X
http://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#move-java.nio.file.Path-java.nio.file.Path-java.nio.file.CopyOption...-
In this kind of question, showing some code (can be a simple example sketch) can help us understanding what is wrong. In general, the problem isn't with the Processing function, but in the way it is used...
And since you interact with the system, indicating what OS you use can help too!