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

Implement deno.readFileSync and deno.writeFileSync #415

Closed
ry opened this Issue Jul 26, 2018 · 4 comments

Comments

3 participants
@ry
Collaborator

ry commented Jul 26, 2018

Here's a pointer to the prototype implementation:
https://github.com/ry/deno/blob/golang/os.go#L171-L195

@ry ry added this to the v0.1 (first binary release) milestone Jul 26, 2018

@benjamingr

This comment has been minimized.

Show comment
Hide comment
@benjamingr

benjamingr Jul 30, 2018

@ry given that we have promise APIs and async/await - maybe skip *Sync APIs entirely?

benjamingr commented Jul 30, 2018

@ry given that we have promise APIs and async/await - maybe skip *Sync APIs entirely?

@ry

This comment has been minimized.

Show comment
Hide comment
@ry

ry Jul 30, 2018

Collaborator

@benjamingr In Node we were surprised to discover that dispatching to the thread pool for FS operations was often much slower than simply calling into blocking syscalls. readFileSync, for example, is a very common operation that should not be made more expensive. Therefore we will provide simple synchronous versions of some common things like readFileSync. For more complex operations, like spawning subprocesses and collecting the output, we will rely on await.

Collaborator

ry commented Jul 30, 2018

@benjamingr In Node we were surprised to discover that dispatching to the thread pool for FS operations was often much slower than simply calling into blocking syscalls. readFileSync, for example, is a very common operation that should not be made more expensive. Therefore we will provide simple synchronous versions of some common things like readFileSync. For more complex operations, like spawning subprocesses and collecting the output, we will rely on await.

@ry ry changed the title from Implement deno.readFileSync and deno.writeFileSync working to Implement deno.readFileSync and deno.writeFileSync Aug 7, 2018

@ry

This comment has been minimized.

Show comment
Hide comment
@ry

ry Aug 7, 2018

Collaborator

#452 implements readFileSync

Collaborator

ry commented Aug 7, 2018

#452 implements readFileSync

@NewLunarFire

This comment has been minimized.

Show comment
Hide comment
@NewLunarFire

NewLunarFire Aug 15, 2018

#519 has an implementation of writeFileSync in Rust

NewLunarFire commented Aug 15, 2018

#519 has an implementation of writeFileSync in Rust

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