Skip to content

Commit

Permalink
Fixed OverlayFS.copyToWritable
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Oct 17, 2024
1 parent 489da43 commit 9a373e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/backends/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ export class UnmutexedOverlayFS extends FileSystem {
}

const data = new Uint8Array(stats.size);
using readable = this.readable.openFileSync(path, parseFlag('r'));
using readable = this.readable.openFileSync(path, 'r');
readable.readSync(data);
using writable = this.writable.openFileSync(path, parseFlag('w'));
using writable = this.writable.createFileSync(path, 'w', stats.mode | 0o222);
writable.writeSync(data);
}

Expand All @@ -521,9 +521,9 @@ export class UnmutexedOverlayFS extends FileSystem {
}

const data = new Uint8Array(stats.size);
await using readable = await this.readable.openFile(path, parseFlag('r'));
await using readable = await this.readable.openFile(path, 'r');
await readable.read(data);
await using writable = await this.writable.openFile(path, parseFlag('w'));
await using writable = await this.writable.createFile(path, 'w', stats.mode | 0o222);
await writable.write(data);
}
}
Expand Down

0 comments on commit 9a373e9

Please sign in to comment.