Skip to content

FileManager.enumerator(at*:) doesn't work on WASI #5420

Description

@kkebo

Motivation

FileManager.enumerator(at:) and FileManager.enumerator(atPath:) doesn't work on WASI since their underlying NSURLDirectoryEnumerator is just a stub on WASI.

The reason why it was a stub was that NSURLDirectoryEnumerator heavily used FTS and the wasi-libc didn't support it then.

https://github.com/apple/swift-corelibs-foundation/pull/4898/files#diff-dd2c49919954783c5266a5dce970eb43c41de6f017c12ad3474afd038f971c5fR1123

Proposed solution

FTS has been supported since wasi-libc 25, and swiftlang/swift main branch and release/6.3 branch are already using the greater version of wasi-libc than 25.

So we can use the proper NSURLDirectoryEnumerator on WASI as well.

Alternatives considered

No response

Additional information

I have already created PRs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    WASIWebAssembly System Interface-related changesbug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions