Currently, the exception message makes sense only if the problem is with the 'to' file path. 1) BAD CASE: import std.file; void main() { rename("some_non_existing_file.txt", "bar.txt"); } Unfortunately, the exception includes the target file name: std.file.FileException@std/file.d(681): bar.txt: No such file or directory [...] DISCUSSION: The fix seems to be trivial by replacing the last argument with fromz below: phobos/std/file.d:681: cenforce(core.stdc.stdio.rename(fromz, toz) == 0, t, toz); However, it's not that simple because in some cases it's toz that needs to be reported. 2) GOOD CASE: import std.file; void main() { // Assuming that foo.txt exists: rename("foo.txt", "some/non/existing/path/bar.txt"); } std.file.FileException@std/file.d(681): some/non/existing/path/bar.txt: No such file or directory [...] So, it makes sense to include both paths.
It set to enforce(false, new FileException( text("Attempting to rename file ", f, " to ", t))); now.