(Note that atomic operations on a directory are totally ordered.)
* Interleaving 1a: the other process' rename precedes our rename in
- step b, and we get an ``IN_MOVED_TO`` event for its rename before
- we do ours. Then we reclassify as a conflict; its changes end up
- at ``foo`` and ours end up at ``foo.conflicted``. This avoids
- data loss.
+ step b, and we get an ``IN_MOVED_TO`` event for its rename by step 2.
+ Then we reclassify as a conflict; its changes end up at ``foo``
+ and ours end up at ``foo.conflicted``. This avoids data loss.
* Interleaving 1b: its rename precedes ours in step b, and we do
- not get an ``IN_MOVED_TO`` event for its rename before ours. Its
+ not get an ``IN_MOVED_TO`` event for its rename by step 2. Its
changes end up at ``foo.old`` and ours end up at ``foo``. This
avoids data loss.
* Interleaving 2: its rename happens between our rename in step b,
does not exist. Nevertheless, no data will be lost. (Probably, the user
will be able to retry the operation.)
+On Windows, [TODO interleavings of rename vs ReplaceFileW].
+
Above we have considered only interleavings with a single other process,
and only the most common possibilities for the other process' interaction
with the file. If multiple other processes are involved, or if a process