Join GitHub today
Regression 126.96.36.199 File#mv #5415
jruby 188.8.131.52-SNAPSHOT (2.5.0) 2018-11-05 d4e5bb6 Java HotSpot(TM) 64-Bit Server VM 25.191-b12 on 1.8.0_191-b12 +jit [linux-x86_64]
FileUtils.mv('/tmp/test', '/tmp/test2') works fine. It fails only if I try to move something into my home folder /home/ahorek
originally found because bundler stopped working
ok, it works with sudo, but jruby 184.108.40.206 or MRI works even WITHOUT sudo, this is the reason:
ATOMIC_MOVE : The move is performed as an atomic file system operation and all other options are ignored. If the target file exists then it is implementation specific if the existing file is replaced or this method fails by throwing an IOException. If the move cannot be performed as an atomic file system operation then AtomicMoveNotSupportedException is thrown. This can arise, for example, when the target location is on a different FileStore and would require that the file be copied, or target location is associated with a different provider to this object.
I quickely tried to use
as a fallback, the file was moved successfuly, but then it failed at this line
I'll investigate more tomorrow
The error is not unexpected; on many Linux distributions,
The problem is that on your system, the error message for this "cross-device link" is in Czech. We're (unfortunately) using the text of the message to know that we should re-raise the IOException from Java as EXDEV.
I'm not sure how to proceed here. Will have to see if there's any other way to determine the cause of the error.
Aha, we may be in luck. If I'm reading the JDK sources properly, it is actually raising a subclass of IOException, AtomicMoveNotSupportedException. That would be a more robust way to detect this, if indeed it is what JDK is raising. I don't suppose you're available right now to help test?