Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dir: Add convenience functions for accessing UTF-8 variants #362

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

cgwalters
Copy link
Contributor

I'd like to make use of the fs_utf8 bits in some of my code, but doing so is tricky as switching Dir types quickly becomes "infectious" across the codebase and forces a larger conversion all at once.

Adding these these two convenience APIs on Dir (the non-UTF8 version) I think greatly improve the ergonomics for the common cases where I may want to view an existing Dir entries (without creating a new file descriptor) and iterate over its entries, and to conveniently open a child dir as a utf-8 version.

There are more methods we could add, but these feel like a useful start to me.

I'd like to make use of the fs_utf8 bits in some of my code,
but doing so is tricky as switching `Dir` types quickly becomes
"infectious" across the codebase and forces a larger conversion
all at once.

Adding these these two convenience APIs on `Dir` (the non-UTF8 version)
I think greatly improve the ergonomics for the common cases
where I may want to *view* an existing `Dir` entries (without
creating a new file descriptor) and iterate over its entries,
and to conveniently open a child dir as a utf-8 version.

There are more methods we could add, but these feel like
a useful start to me.
@sunfishcode
Copy link
Member

Makes sense, thanks!

@sunfishcode sunfishcode merged commit 401a42c into bytecodealliance:main Jul 23, 2024
21 of 22 checks passed
@sunfishcode
Copy link
Member

This is now released in cap-std 3.3.0.

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.

2 participants