GNOME Bugzilla – Bug 720217
If transfer to device fails with non-sanitized filename, try with sanitized one
Last modified: 2018-05-24 18:04:09 UTC
I bought a 64GB microSD card and it was exfat-formatted from the factory. As per http://www.ntfs.com/exfat-filename-dentry.htm , exfat has similar filename restrictions to other FAT filesystems: no ", *, /, :, <, >, ?, \ or |. Rhythmbox has code to sanitize filenames when transferring to FAT-ish filesystems, but there's a particular problem with exfat at present. There's no blessed in-kernel exfat implementation, the most commonly used one is fuse-exfat, a FUSE implementation. Rhythmbox calls glib which then uses statfs(2) to determine the filesystem type of the target device, and moch says it's not really practical to fix things anywhere in that stack to detect the correct type for FUSE filesystems. So we can't really properly detect exfat mounts and know that we need to sanitize filenames for them, at least until there's an in-kernel exfat implementation, and that may not happen soon or ever. So, moch suggests instead: <moch> rb probably needs to try sanitising filenames for fat-like filesystems when it gets told it can't create a file i.e., if file creation fails when transferring to a device, try again with a FAT-sanitized filename. Bit inelegant, but it seems like a sane approach, I can't think of a case where it would cause problems.
I noted that gnome-disks at least is aware the partition is exFAT *somehow*, so it is possible, but it may not be practical for RB to do it however gnome-disks does it. I haven't looked at how gnome-disks does it yet.
gnome-disks looks directly at the block device, which is not possible in rhythmbox. I've added retry with sanitized name in commit 0a1ea85.
Well, I just transferred some files with 3.0.3 - which is long after that commit - and it failed on "Would You Fight For My Love?" (track 04 from Lazaretto by Jack White) :/ I checked it didn't just display a failure but retry successfully - there is definitely no matching file on the device.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/1316.