linuxwindowsunison

Problems with whitespaces when syncing between Linux/Windows?


I'm using unison version 2.51.2 (ocaml 4.06.1) to sync files between a Synology NAS (BTRFS filesystem) and a Windows 2016 Server (NTFS filesystem). I'm trying to sync one-way from Linux to Windows using the -force option. I seem to experience some issues with files containing whitespaces like

The name of this Unix file is not allowed under Windows.  (File 'Dermapharm/013165/zwi/013165_27556_41955_1_PU_2019-09-02_Fexofenaderm 120 mg Filmtabletten/var/013165_27556_41955_1_PU_1_2019-09-02_Fexofenaderm ')

which indicates a file ending on whitespace which is indeed not allowed in Windows. However, when I descend into the dir, there is NO such file ending with whitespace! A ls -la yields

013165_27556_41955_1_PU_1_2019-09-02_Fexofenaderm 120 mg Filmtabletten.rtf

I cannot determine a clear pattern, because this seem to happen only for a few files... (like 100 compared to 150.000 containing whitespace which work fine). Does anyone have an idea what could be the cause for this?


Solution

  • The problem was not related to Unison. There were indeed some corrupted files with the above mentioned name that did not show via SMB (due to the trailing space). After removing these files via PowerShell everything works fine.