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

deno.open() doesn’t support write or append #886

Closed
ry opened this issue Oct 3, 2018 · 7 comments
Closed

deno.open() doesn’t support write or append #886

ry opened this issue Oct 3, 2018 · 7 comments
Assignees

Comments

@ry
Copy link
Member

ry commented Oct 3, 2018

Only read currently.

deno/js/files.ts

Lines 29 to 52 in 3c080ca

// TODO This is just a placeholder - not final API.
export type OpenMode = "r" | "w" | "w+" | "x";
export function create(filename: string): Promise<File> {
return open(filename, "x");
}
export async function open(
filename: string,
mode: OpenMode = "r"
): Promise<File> {
const builder = new flatbuffers.Builder();
const filename_ = builder.createString(filename);
fbs.Open.startOpen(builder);
fbs.Open.addFilename(builder, filename_);
const msg = fbs.Open.endOpen(builder);
const baseRes = await dispatch.sendAsync(builder, fbs.Any.Open, msg);
assert(baseRes != null);
assert(fbs.Any.OpenRes === baseRes!.msgType());
const res = new fbs.OpenRes();
assert(baseRes!.msg(res) != null);
const fd = res.rid();
return new File(fd);
}

@piscisaureus piscisaureus self-assigned this Oct 4, 2018
@piscisaureus
Copy link
Member

Assigning self to not forget about this.

@kanishkarj
Copy link
Contributor

Hey! Can I work on this?

@kevinkassimo
Copy link
Contributor

@kanishkarj I think there is still some decisions need to make about the mode design before implementation could start

@ztplz
Copy link
Contributor

ztplz commented Oct 4, 2018

@kevinkassimo I Agree.

@kanishkarj
Copy link
Contributor

Okayy..

@bartlomieju
Copy link
Member

Done in #1282 #1336.

Released in v0.2.3

CC @ry

@ry
Copy link
Member Author

ry commented Feb 12, 2019

thx

@ry ry closed this as completed Feb 12, 2019
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

6 participants