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

Rewrite readFile and writeFile #2000

Merged
merged 11 commits into from
Mar 28, 2019
Merged

Conversation

bartlomieju
Copy link
Member

Closes #1989

js/read_file.ts Show resolved Hide resolved
@bartlomieju
Copy link
Member Author

bartlomieju commented Mar 26, 2019

@ry it looks like open and writeFile have incompatible APIs...

For example:

const options: WriteFileOptions = {
   create: false,
   append: true,
}  // there is no `OpenMode` that would suffice this condition

Deno.writeFile("foo.txt", ..., options);

Should I handle that, by doing stat beforehand to check if file exists and bail out if it doesn't or would we rather change APIs?

EDIT: Please check writeFile in diff

@bartlomieju
Copy link
Member Author

@ry ready for review

js/files.ts Show resolved Hide resolved
js/deno.ts Show resolved Hide resolved
js/buffer.ts Show resolved Hide resolved
@bartlomieju
Copy link
Member Author

@ry @kevinkassimo ready for round two

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you - LGTM

@ry ry merged commit 597ee38 into denoland:master Mar 28, 2019
@bartlomieju bartlomieju deleted the rework_readwrite_file branch March 28, 2019 09:32
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.

None yet

3 participants