Skip to content

Atomic file writing for WASI #1557

@MaxDesiatov

Description

@MaxDesiatov

Mirrored from swiftwasm/swift#5594

Description

Currently, Swift doesn't support the following code when using Wasm Swift SDK.

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: swiftwasm/swift#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