When copying files from filesystems that allow longer filenames (e.g. Windows NTFS,
which stores filenames as UTF-16 allowing 255 UTF-16 code units) to Linux ext4/xfs
which limits filenames to 255 bytes, rsync currently fails with ENAMETOOLONG and
skips the file entirely.
A --truncate-long-names option would allow rsync to truncate the filename to fit
within the destination filesystem's limit, preserving the file content. The truncated
name could preserve the extension.
This is a real use case when migrating libraries from Windows to Linux where filenames
contain multibyte UTF-8 characters (e.g. Cyrillic, CJK) that were valid on NTFS but
exceed 255 bytes in UTF-8 encoding.
When copying files from filesystems that allow longer filenames (e.g. Windows NTFS,
which stores filenames as UTF-16 allowing 255 UTF-16 code units) to Linux ext4/xfs
which limits filenames to 255 bytes, rsync currently fails with ENAMETOOLONG and
skips the file entirely.
A --truncate-long-names option would allow rsync to truncate the filename to fit
within the destination filesystem's limit, preserving the file content. The truncated
name could preserve the extension.
This is a real use case when migrating libraries from Windows to Linux where filenames
contain multibyte UTF-8 characters (e.g. Cyrillic, CJK) that were valid on NTFS but
exceed 255 bytes in UTF-8 encoding.