Open lgarron opened 1 month ago
I'm guessing bun
sees that both arguments are Bun.file
objects and attempts to invoke a file copy syscall as an optimization under the assumption that stdin
has a file path.
There also seems to be something broken with the TypeScript types, as this does not pass type checking but is clearly correct:
import { stdin, write } from "bun";
const blob = await new Response(stdin.stream()).blob();
await write(Bun.file("foo.txt"), blob);
It seems I can't take an object of type Blob
and assign it to a variable of type Blob
?
What version of Bun is running?
1.1.26+0a37423ba
What platform is your computer?
Darwin 24.0.0 arm64 arm
What steps can reproduce the bug?
Run the following:
What is the expected behavior?
bun
writes the contents ofstdin
tofoo.txt
.What do you see instead?
ENOTSUP: Operation not supported errno: -45 syscall: "fcopyfile"
Additional information
No response