mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-25 09:50:59 +00:00
An fcntl lock belongs to the process and goes with the first close of any other descriptor to the lock file, so a backup or an export walking the data dir could drop the guard's lock without a trace. On POSIX the guard holds a flock on its own open file instead, which nothing else in the process can release; Windows keeps LockFileEx. The Windows write probe opened the target for writing and took a sharing violation for a refusal, so a file another process merely held open was not saved at all; only a real denial refuses now, since the rename that follows moves an open destination aside. A file moved aside by a refused rename may be the last copy of a file or a file since deleted on purpose, so the sweep logs it and leaves it to the user rather than removing or restoring it. The sweep throttles itself per directory, so a load followed by a save reads each directory once, and the identity check on the lock file runs at most once a second, so a scan of hundreds of presets pays for it once. A config that stays unwritable backs off for longer with each failure in a row, and its backup copy is written after the config, never before. The Windows identity helper is shared with the rename that already computed it, and the header comment that had lost its indentation and its neighbour's description is whole again.
OrcaSlicer tests
Building, running and writing tests is documented on the wiki, under How to Test.
Two files here rather than there, because coding agents only read what is in the repository: