mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
Motivation: When a file is created 'atomically' and the descriptor is detached from its handle then the user is provided with the descriptor for a temporary file, and the desired file is never created. Modifications: Where supported, atomically created files use a temporary unnamed file which is then linked on close. Elsewhere a temporary named file is created which is renamed on closed. Temporary unnamed files are linked in detach but not closed. Temporary named files are linked to the desired path before being unlinked. - Break out the logic for materializing a file created using a temporary unnamed file - Add syscalls and error mappings for link(2) and unlink(2) Result: Atomically created files behave as expected when detached