Bug 432509

Summary: Cannot trash files with long names
Product: [Frameworks and Libraries] frameworks-kio Reporter: Ilya Bizyaev <bizyaev>
Component: TrashAssignee: KIO Bugs <kio-bugs-null>
Status: ASSIGNED ---    
Severity: normal CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: 6.7.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Ilya Bizyaev 2021-02-04 15:42:43 UTC
SUMMARY
Sometimes a file with a long name cannot be moved to trash.


STEPS TO REPRODUCE
1. Find a JPEG image and call it: "Файл с длинным именем — сам себя не создаст: что происходит, если удалить файл, в имени которого — целое предложение на русском языке.jpeg" (no newlines)
2. Attempt to move it to trash with Dolphin or kioclient5

OBSERVED RESULT
Error message: "Could not write to file /home/user/.local/share/Trash/info/[filename].trashinfo"

EXPECTED RESULT
File is successfully moved to trash

SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.2
KDE Plasma Version: 5.20.90
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Comment 1 Ilya Bizyaev 2021-02-18 13:41:59 UTC
A simpler test case is:
$ touch "уууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууууу.txt"

Here I used Cyrillic 'у'. If I replace it with Latin 'y', the file is trashed as expected, which hints at a wrong byte size limit somewhere.
Comment 2 Ilya Bizyaev 2021-02-18 17:53:09 UTC
The byte size limit is apparently that of ext4: 255 bytes for the filename.

.trashinfo cannot be created because it increases the filename byte size over the limit.

This needs a better error message or a different trash infrastructure that does not require metadata files with longer names.
Comment 3 Bug Janitor Service 2025-11-25 07:55:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/2064