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

Unable to delete files when project is on non-/home drive / mount point without pre-existing .Trash folder #79108

Closed
romlok opened this issue Jul 6, 2023 · 1 comment · Fixed by #79284

Comments

@romlok
Copy link
Contributor

romlok commented Jul 6, 2023

Godot version

v4.1.stable.official [9704596] < Steam

System information

Godot v4.1.stable - Debian GNU/Linux trixie/sid trixie - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 1060 (nvidia) - Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (6 Threads)

Issue description

On this machine, I have my projects stored on a separate drive to my system and home directory. This drive is mounted at /data.

Since 4.1, if I attempt to delete a project file through the in-editor file browser, I get an error dialog (though the window opens much larger than this screenshot):

Screenshot_20230706_161340

The editor output console shows the (misleading) error:

platform/linuxbsd/os_linuxbsd.cpp:968 - move_to_trash: No such file or directory as /data/src/godot/default/new_script.gd.

However, if Godot is run from the command-line, we also get the following additional information prior to that error output:

gio: file:///data/src/godot/default/new_script.gd: Unable to find or create wastebasket directory /data/.Trash-1000 to move /data/src/godot/default/new_script.gd to

Indeed, the root of the /data mount point is not writeable by regular users, and there's no trash directory in there already.

Prior to 4.1, it appears that deleted files would be moved into my home dir's trash, across filesystems, since my ~/.local/share/Trash is seemingly full of stuff I have previously deleted from my current project.

Steps to reproduce

  1. Use Linux
  2. Create or open a project on a secondary drive (one which doesn't also contain your home dir).
  3. Open the project in the Godot editor
  4. Delete a file (eg. icon.svg) from the editor's FileSystem panel.
  5. 👀 ❗

Minimal reproduction project

n/a

@akien-mga akien-mga changed the title Unable to delete files when project is on non-/home drive / mount point Unable to delete files when project is on non-/home drive / mount point with pre-existing .Trash folder Jul 6, 2023
@akien-mga akien-mga changed the title Unable to delete files when project is on non-/home drive / mount point with pre-existing .Trash folder Unable to delete files when project is on non-/home drive / mount point without pre-existing .Trash folder Jul 6, 2023
@starccy
Copy link

starccy commented Jul 9, 2023

I have a similar situation. I am using Linux with Godot as the same version as @romlok.

I created my project in a tmpfs type filesystem.
When I try to delete a file from the editor, I got an error:

ERROR: move_to_trash: No such file or directory as /tmp/test/test.gd.

I also see the gio output from the console before the error message but different with @romlok:

gio: file:///tmp/test/test.gd: Trashing on system internal mounts is not supported

@akien-mga akien-mga added this to the 4.2 milestone Jul 10, 2023
@akien-mga akien-mga self-assigned this Jul 10, 2023
YuriSizov pushed a commit to YuriSizov/godot that referenced this issue Jul 11, 2023
We can't rely on the error code from `gio` or `kioclient5`, in my
rudimentary testing they return `1` for both missing files and other
situations like not having a Trash can on the mounted volume.

Fixes godotengine#79108.

(cherry picked from commit a6e75f3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants