Skip to content

sdk/rust: Fix hostfs create_file() failing with EEXIST on existing files#315

Open
penberg wants to merge 1 commit intomainfrom
fix-hostfs-create-file
Open

sdk/rust: Fix hostfs create_file() failing with EEXIST on existing files#315
penberg wants to merge 1 commit intomainfrom
fix-hostfs-create-file

Conversation

@penberg
Copy link
Collaborator

@penberg penberg commented Feb 6, 2026

Replace O_EXCL with O_TRUNC in create_file for both Linux and Darwin hostfs backends. The FUSE create op is called by the kernel for open(O_CREAT) on existing files (e.g. cargo overwriting .d dependency files), so create_file needs to truncate rather than fail. Higher-level callers already guard against unwanted overwrites with their own existence checks.

Replace O_EXCL with O_TRUNC in create_file for both Linux and Darwin
hostfs backends. The FUSE create op is called by the kernel for
open(O_CREAT) on existing files (e.g. cargo overwriting .d dependency
files), so create_file needs to truncate rather than fail. Higher-level
callers already guard against unwanted overwrites with their own
existence checks.
@penberg penberg force-pushed the fix-hostfs-create-file branch from d2788f3 to b080d1e Compare February 6, 2026 09:36
@penberg penberg marked this pull request as ready for review February 6, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant