[fix] Improve handling of illegal vFAT filenames.#14043
Conversation
This change fixes an issue where a file/directory is not created when its name contains trailing spaces or dots. The issue has been observed on a Kobo device, but probably also applies to other systems using vFAT. We also might want to consider handling other illegal vFAT filenames like `NUL` or `AUX`. Please see the [official Microsoft documentation](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) for more details on the naming conventions of vFAT (this change addresses the last bullet point).
It would seem that trailing dots are created, but the dots generally aren't shown and the name counts as a duplicate to without trailing dots or a different number of trailing dots. That's not an objection to stripping them or anything, mind. |
|
I see your point. Actually, the current implementation would also treat |
|
No, I don't consider that a concern. I was describing the behavior of the /mnt/onboard filesystem on Kobo for the sake of accuracy. Only trailing spaces are problematic, give or take the edge case of trailing spaces followed by trailing dots. Creating a folder with the name |
This change fixes an issue where a file/directory is not created when its name contains trailing spaces or dots. The issue has been observed on a Kobo device, but probably also applies to other systems using vFAT. We also might want to consider handling other illegal vFAT filenames like `NUL` or `AUX`. Please see the [official Microsoft documentation](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) for more details on the naming conventions of vFAT (this change addresses the last bullet point).
This change fixes an issue where a file/directory is not created when its name contains trailing spaces or dots. The issue has been observed on a Kobo device, but probably also applies to other systems using vFAT.
We also might want to consider handling other illegal vFAT filenames like
NULorAUX.Please see the official Microsoft documentation for more details on the naming conventions of vFAT (this change addresses the last bullet point).
This change is