FileWrapper(directoryWithFileWrappers:).write(…) erroneously deletes existing folders & files

· Wadetregaskis · Nov. 12, 2026, 7:51 p.m.
Summary
The blog post discusses an issue with the FileWrapper implementation on Apple platforms, where it unexpectedly deletes existing files and directories during a write operation instead of updating or failing gracefully. The author shares code to reproduce the bug and highlights the importance of using the `.atomic` write option to avoid such issues.