Wenn ich mit move() eine Datei verschieben / umbenennen möchte wird zwar die Zieldatei (moved.txt) angelegt aber die ursprüngliche Datei (test2.txt) existiert weiterhin (Windows 8.1)
try
{
Path src = Paths.get("C:\\temp_","test2.txt");
Path movnam = Paths.get("C:\\temp_","moved.txt");
Files.move(src,movnam,StandardCopyOption.REPLACE_EXISTING); //,StandardCopyOption.ATOMIC_MOVE);
} catch (Exception e)
e.printStackTrace();
}
try
{
Path src = Paths.get("C:\\temp_","test2.txt");
Path movnam = Paths.get("C:\\temp_","moved.txt");
Files.move(src,movnam,StandardCopyOption.REPLACE_EXISTING); //,StandardCopyOption.ATOMIC_MOVE);
} catch (Exception e)
e.printStackTrace();
}