Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script I used to rename and move photos.
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Files;
import java.io.IOException;
public class RenamePhotos {
public static void main (String[] args) throws IOException {
try {
var dest = new java.io.File("/run/secret/").toPath();
var photos = new java.io.File("/run/secret/blah").listFiles();
for (var photo: photos)
Files.move( photo.toPath() , (dest.resolve("(1)"+ photo.toPath().getFileName())) );
} catch (IOException ioe) { System.out.println("Crap."); System.exit(1); }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.