opened
yebblies
username_0
I don't think it's possible to unittest this without making excessive assumptions.

https://issues.dlang.org/show_bug.cgi?id=15621
Issue 15621 - std.file.rename does not allow moving files to a different drive
issue
created
wilzbach
username_1
Can someone assign the decision to Andrei? Seems like we need a judge & final decision :/
comment
created
andralex
username_2
Cool, I assume the Posix version already has the capability.
comment
created
braddr
username_3
Removed the auto-merge tag since the presumption is false.
@username_2 posix does not rename across disks, see the feb 2 comment from @schuetzm
comment
created
andralex
username_2
Eh, in that case we need to get the Posix version done. An implementation with diverging capabilities on different OSs does more harm than good. @username_0 please reopen when up for it, thx!
comment
created
yebblies
username_0
Ok, implementing the posix fallback should be easy since copy and delete are already part of this module.
comment
created
marler8997
username_4
@username_0 

I ran into this problem with http://github.com/username_4/rund  It looks like you were going to modify this PR to also work on POSIX...are you able to do that and finish this PR?
comment
created
jmdavis
username_5
I don't have a Linux system to test this behavior at the moment, but I can guarantee that FreeBSD won't rename across filesystems, and I run into this problem fairly often. AFAIK, the only way to make this work in general is to try `rename`, and then if it fails, try to copy the file and then delete the original. But at this point, if we do something like that, I think that it should probably be a new function which is explicit about this behavior - particularly since the name `rename` carries with it certain expectations (particularly for those familiar with POSIX), and changing the current behavior could have unexpected consequences in existing code.
comment
created
jmdavis
username_5
Honestly, I'd rather have a new function, particularly since the behavior of `rename` carries with it the implication of `CanCopy.no`, and it's way more verbose to have to pass a flag for what is arguably the default behavior that many folks will want. The other nasty question here is what to do about directories. With `rename`, you can move a directory, and it's not a problem, but with a function designed to actually move a file and not just rename it, moving a directory could entail recursively copying the directory and the deleting the original. I'd be tempted to argue that we should punt on that and just add `moveFile` which only works on files and not directories.
comment
created
marler8997
username_4
https://github.com/dlang/phobos/pull/6417
comment