Skip to content

String.write(toFile:atomically:encoding:) fails even with atomically: false only on WasmKit #178

Closed
@kateinoigakukun

Description

@kateinoigakukun

Reproduction steps

$ swift package init --name Check --type executable
$ cat <<EOS > Sources/main.swift
import Foundation
let text="test"
do {
  try text.write(toFile: "test.txt", atomically: false, encoding:.utf8)
} catch {
  print("Error: \(error)")
}
EOS
$ swift build --swift-sdk $SWIFT_SDK_ID
$ wasmkit-cli run --dir . .build/debug/Check.wasm
Error: Error Domain=NSCocoaErrorDomain Code=512 "(null)"UserInfo={NSFilePath=test.txt, NSURL=test.txt -- file:///}

wasmtime run --dir . .build/debug/Check.wasm succeeded without throwing the exception.

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