Follow-up to #66. While validating the poll-parked Blob I/O ownership work in #569, the unchanged pinned Bun file corpus exposed a distinct FileCopier gap.
Authoritative reproduction in the installation-shaped Home runtime:
- Create a 200-byte regular file
a. - Evaluate
await Bun.write(Bun.file(b), Bun.file(a)). - Home returns
0and leavesbat zero bytes; the source remains 200 bytes. - The unchanged
js/bun/io/bun-write.test.jstherefore fails itsBun.file -> Bun.filesequence when it expects the destination to equalexampleHtml.
This is separate from byte-backed WriteFile and ReadFile polling: the exact bun-file-read.test.ts, blob-write.test.ts, and worker_blob.test.ts files pass 16/16, and #569 covers blocked read/write task ownership.
Required completion:
- port the regular-file Blob-to-Blob optimized copy path without falling back to JS or byte materialization;
- preserve source/destination slice offset and length semantics;
- return the exact copied byte count;
- preserve truncate/createPath/error behavior and metadata updates;
- run the complete unchanged
js/bun/io/bun-write.test.jsfile and focused regular/sliced file-copy controls in Debug and ReleaseFast; - do not weaken concurrency, assertions, workloads, deadlines, or skips.