Few days ago, my little brother (13 years old) ask me about writing some small utility. He needed find all files with selected extensions and move them to some another location. He asked me about using D or C# for it. My answer was: try both and you will see which one suited you better.

After few hours he came to me and said that C# is better. When I asked why he answered me that in D there is no std.file.move method (I know there is a rename method but it is not obvious) so he has to use std.file.copy and std.file.remove. And when he try it with just std.file.copy (so he does not use remove yet) he end up with remove all files anyway. When std.file.copy is used with same src and dst (this was caused by anoher mistake) it removes original file and does not make the new one.

Maybe it would be nice to have alias for rename method or have better doc for rename. And probably we should fixed copy method to not remove files with same src and dst path :)

Reply via email to