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

Remove fs.promises.readSync. #810

Closed
jo-carter opened this issue Oct 30, 2024 · 2 comments
Closed

Remove fs.promises.readSync. #810

jo-carter opened this issue Oct 30, 2024 · 2 comments
Assignees
Labels

Comments

@jo-carter
Copy link
Contributor

jo-carter commented Oct 30, 2024

.name.string = njs_str("readSync"),

All other promise fs functions have their "Sync" postfix removed. Is leaving it in for readSync intentional?

.name.string = njs_str("read"),

I see there is also a fs.promises.read function that appears to be identical.

@jo-carter jo-carter added the bug label Oct 30, 2024
@xeioex xeioex self-assigned this Oct 30, 2024
@xeioex
Copy link
Contributor

xeioex commented Oct 31, 2024

Hi @jo-carter,

All other promise fs functions have their "Sync" postfix removed. Is leaving it in for readSync intentional?

There is no fs.promises.read() in nodejs. So, read() is unlike other methods.
readSync() should be removed from fs.promisesthough, thanks.

I see there is also a fs.promises.read function that appears to be identical.

Actually it is not fs.promises.read but filehandle.read.
We have filehandle partially implemented.

While they share the same C function, their behaviour is different depending on the magic8 constant.

@jo-carter jo-carter changed the title fs.promises.readSync should be fs.promises.read? Remove fs.promises.readSync. Nov 1, 2024
@jo-carter
Copy link
Contributor Author

jo-carter commented Nov 1, 2024

Hi @xeioex

There is no fs.promises.read() in nodejs. So, read() is unlike other methods.
readSync() should be removed from fs.promisesthough, thanks.

Ah yes you're right, I forgot about that quirk in NodeJS's non-promise fs API.

Actually it is not fs.promises.read but filehandle.read.
We have filehandle partially implemented.

Yes, I also missed that this was for filehandles while scrolling through :)

xeioex added a commit to xeioex/njs that referenced this issue Nov 6, 2024
xeioex added a commit to xeioex/njs that referenced this issue Nov 6, 2024
@xeioex xeioex closed this as completed in 1a6cc6d Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants