Skip to content

Atomic file writing #5594

Open
Open
@kkebo

Description

@kkebo

derived from #5593

Description

Currently, SwiftWasm doesn't support the following code for wasm32-unknown-wasi:

import Foundation
Data().write(to: URL(filePath: "hoge"), options: .atomic)

It's because the option .atomic requires creating a temporary file, and swift-foundation doesn't support it if os(WASI).

Ideas

One idea: #5593 (comment)

How about allowing atomic file writing when TMPDIR environment variable is explicitly defined?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions