mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-18 14:36:35 +02:00
Saving writes a temporary file and renames it over the destination. A rename only needs the folder to be writable, so on Linux and macOS a read-only (chmod 444) file was silently replaced, while on Windows the rename failed with a vague "locked or read-only" access error. atomic_write now asks the AtomicFs whether the existing destination is read-only (new `is_readonly`, false by default for other implementors) and refuses before anything is written: "cannot save <file>: the file is read-only; the original file was not changed". New files and writable files save as before. Photoshop refuses the same way; the user saves a copy with Save As. Tests: a fake AtomicFs reporting read-only gets the error with nothing written or renamed; a real file marked read-only keeps its bytes and mode and gets the clear message on every platform. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| fuzz | ||
| src | ||
| tests | ||
| Cargo.toml | ||