summaryrefslogtreecommitdiff
path: root/std/archive
diff options
context:
space:
mode:
Diffstat (limited to 'std/archive')
-rw-r--r--std/archive/tar.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/std/archive/tar.ts b/std/archive/tar.ts
index 6bc2b92d0..699b982a9 100644
--- a/std/archive/tar.ts
+++ b/std/archive/tar.ts
@@ -39,15 +39,15 @@ const ustar = "ustar\u000000";
class FileReader implements Deno.Reader {
private file?: Deno.File;
- constructor(private filePath: string, private mode: Deno.OpenMode = "r") {}
+ constructor(private filePath: string) {}
public async read(p: Uint8Array): Promise<number | Deno.EOF> {
if (!this.file) {
- this.file = await Deno.open(this.filePath, this.mode);
+ this.file = await Deno.open(this.filePath, { read: true });
}
const res = await Deno.read(this.file.rid, p);
if (res === Deno.EOF) {
- await Deno.close(this.file.rid);
+ Deno.close(this.file.rid);
this.file = undefined;
}
return res;