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

Some shims are buggy #12

Closed
bartlomieju opened this issue Sep 18, 2021 · 2 comments
Closed

Some shims are buggy #12

bartlomieju opened this issue Sep 18, 2021 · 2 comments

Comments

@bartlomieju
Copy link
Member

After quick glance I found a few shims that are buggy - they do something else in Node than they intend to do in Deno.

  • Deno.read()
  • Deno.readSync()
  • Deno.write()
  • Deno.writeSync()

Namely:

const { bytesRead } = await _read(rid, buffer, 0, buffer.length, null);

Node expects fd (file descriptor) as first argument, but rid is not that. Resource ids are internal Deno representation and they don't map to file descriptors.

That said, we are on track to deprecate these APIs (alongside Deno.seek() and Deno.seekSync() in 1.15 (denoland/deno#12107) and to be removed in 2.0; so that shouldn't be a big deal.

@dsherret dsherret added the bug Something isn't working label Oct 8, 2021
@trgwii
Copy link
Contributor

trgwii commented Oct 9, 2021

We made a decision to keep file descriptors as rids in deno.ns rather than keep an internal mapping, if you're up for making a proper resource table implementation in userland we could do that instead.

@trgwii
Copy link
Contributor

trgwii commented Oct 11, 2021

Working as expected, given that raw file descriptors are returned from all deno.ns calls that produce "rids".

@dsherret dsherret removed the bug Something isn't working label Oct 11, 2021
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

No branches or pull requests

3 participants