Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileSystem rename wrongly reports name collisions #42992

Closed
bitbutter opened this issue Oct 22, 2020 · 8 comments
Closed

FileSystem rename wrongly reports name collisions #42992

bitbutter opened this issue Oct 22, 2020 · 8 comments

Comments

@bitbutter
Copy link

bitbutter commented Oct 22, 2020

Godot version: 3.2.2

OS/device including version:

iMac
Operating system: Darwin-19.3.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 580 OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.5.5

Issue description:

Renaming a file/folder incorrectly gives an error saying a file with that name already exists (when other files/folders exist with the same name but different capitalisation)

Screenrecording here:
https://youtu.be/oUrgX4JB6fU

Minimal reproduction project:

namingbug.zip

Open the attached project. in the FileSystem panel try to rename the "node2D" folder to "Node2D". The rename operation fails. But if you first rename it to (e.g) "xode2D", and then to "Node2D" the operation works.

@dalexeev
Copy link
Member

when other files/folders exist with the same name but different capitalisation

I assume this is for Windows compatibility.

But if you first rename it to (e.g) "xode2D", and then to "Node2D" the operation works.

This is weird and needs to be fixed.

@akien-mga
Copy link
Member

That means your macOS is likely configured to use a case insensitive filesystem, in which case two files with the same name but different case can't coexist. You'd get the same error on Windows, and the trick of renaming to a different name to then rename back with fixed case is pretty common there.
I don't think Godot can improve this with the API offered by Windows (didn't check for macOS).

@bitbutter
Copy link
Author

bitbutter commented Oct 23, 2020

the odd thing is that (as far as i can see), even with case-insensitivity, i don't think i'm asking the filesystem to create anything with a name collision. i'm asking to name a folder Node2D (inside it is a file named Node2D.tscn, but there's nothing named Node2D at the same location as the folder).

you can see the same in the screenrecording, even with case insensitivity i don't think operation would result in a collision, but it's not allowed: https://www.youtube.com/watch?v=oUrgX4JB6fU&feature=youtu.be

@akien-mga
Copy link
Member

On your screen recording, you rename "avatar.tscn" to "Avatar.tscn", which is the same file name for a case insensitive filesystem. The message might be confusing as it refers to conflicts with a "file or folder", but it's really the original file you're trying to rename which conflicts with itself.

Similar in the MRP, renaming the "node2D" folder to "Node2D" will conflict with itself. It works fine on Linux with a case sensitive filesystem.

@akien-mga
Copy link
Member

Paging @bruvzg in case the file move implementation can be improved for macOS, but last I checked for Windows, this is fairly complex to solve (if at all possible - previous attempts have failed).

@bitbutter
Copy link
Author

Ah, odd. I've never seen this behaviour before on a mac. e.g. renaming a file to swap the case of one of the letters in the finder gives no problems. https://youtu.be/h78z42vuLjY

@Alexwaukee
Copy link

This happened to me too on renaming a folder.
Changing the first letter from a capital B to a lower case b.
I could change it in the filesystem outside of Godot, but not inside of Godot.
Version 3.5

@akien-mga
Copy link
Member

Duplicate of #19592

@akien-mga akien-mga marked this as a duplicate of #19592 Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants