File sync from Debian GNU/Linux and flash drive (FAT32)

This is an observation after a couple of weeks of working with Scrivener for Linux. I installed Scrivener for Linux on my 64-bit Debian/GNU Linux laptop. I do not have any experience running Scrivener on any other operating system.

At the end of every working session, I synchronize files on my laptop with a desktop PC (also running Linux), and to a USB flash drive (formatted with FAT32). I use Unison, an rsync-based file synchronization utility, to manage the synchronizations.

All of the Scrivener files sync as expected between my Linux laptop and my Linux desktop. Unison also works as expected on the flash drive for all of the files in the .scriv folder except ProjectNotes, Files, Settings, Snapshots, and /Files/Docs.

The error message emitted by Unison is basically the same. For example:

Error in creating directory:
Invalid argument [mkdir(/media/6DEB-E029/debian-laptop/Writing/sphinx/prose/blackorchids/BlackOrchid.scriv/shortstory046.scriv/Files/.unison.Docs.a0aeb019b1f17202497b0f40f1c714c2.unison.tmp)]

Since these folders synced as expected with the desktop computer (running the same OS and file system as the laptop), I suspected the issue had something to do with the FAT32 file system on the flash drive.

When I looked in the BlackOrchid.scriv folder (to pick one), I saw two sub-folders:


note: The backslash in the second folder is part of the folder name, not part of the path.

So, I ran a simple experiment. I opened a terminal window on the flash drive’s file system and ran the following ‘mkdir’ command (the command listed as having an invalid argument in the error message):

$ mkdir ./temp\

The folder ‘temp’ was created (‘temp’, not ‘temp’). The ‘mkdir’ command ignored the backslash in the folder name that I provided as an argument (‘temp’). That makes sense to me as the backslash indicates a directory in the FAT file systems and is, therefore, an illegal character in a folder or file name.

I concluded that it is the backslash (’’), common to all of the files where the sync failed, that causes the Linux ‘mkdir’ command to fail when writing the Scrivener-generated files to the FAT32 file system on the flash drive. (Please correct my conclusion if it is erroneous or incomplete.)

Based on that conclusion, my questions are:

Why does Scrivener create directories with the backslash character as part of the folder name?

What problem, if any, will the failure to sync those files to the flash drive cause if I try to edit the projects the files belong to on the flash drive using Scrivener for Windows from a different PC?

If this forum is not the right place for my observations and questions, please accept my apology and point me in the right direction.

Thank you in advance for your help,


\ is the escape sequence in unix shells. It tell the shell that the next character should be interpreted literally and not parsed as normal. Most apps (like mkdir) utilize the same escape sequence (it is an env variable) for consistency. Blah blah blah.

You could try setting you escape sequence to something else, but that would get hairy if you followed other docs expecting \ as the esc. I just checked on ext4 and mkdir test\ works to get test. you might try formating a spare flash as ext4 and see if that helps.