godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.96k stars 21.15k forks source link

`DirAccess.rename_absolute()` doesn't work when `from` and `to` paths are on different partitions #97097

Closed svetogam closed 1 month ago

svetogam commented 1 month ago

Tested versions

System information

Godot v4.4.dev2 - Debian GNU/Linux 11 (bullseye) 11 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 660 (nvidia) - Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz (4 Threads)

Issue description

When the two parameters of DirAccess.rename_absolute() are on different partitions, it returns error code 1 and does nothing. I expect it to move the file instead. It works correctly when the two parameters are on the same partition, and when using DirAccess.copy_absolute() instead.

Steps to reproduce

  1. Assign drive_1 and drive_2 variables to paths on different partitions.
  2. Delete the return line.
  3. Run the MRP.
  4. Verify that it failed by reading in the console output that the last two error codes are 1 and the last two booleans are false.

Minimal reproduction project (MRP)

rename-between-partitions.zip

svetogam commented 1 month ago

I tested this between 3 partitions. 2 had filesystem ext4 and 1 had filesystem ntfs.

I think #78440 could be the same bug. That MRP works for me and doesn't move between partitions on my system.

akien-mga commented 1 month ago

CC @bruvzg @KoBeWi

KoBeWi commented 1 month ago

Can't reproduce on Windows.

bruvzg commented 1 month ago

Can't reproduce on macOS, but is reproducible on Linux.