将文件复制到另一个位置
使用 Bun.write() 将文件复制到磁盘上的另一个位置。第一个参数是_目标位置_,例如绝对路径或 BunFile 实例。第二个参数是要写入的_数据_。
TypeScript
const file = Bun.file("/path/to/original.txt");
await Bun.write("/path/to/copy.txt", file);
请参阅 Bun.write()。
使用 Bun.write() 将文件复制到磁盘上的另一个位置。第一个参数是_目标位置_,例如绝对路径或 BunFile 实例。第二个参数是要写入的_数据_。
const file = Bun.file("/path/to/original.txt");
await Bun.write("/path/to/copy.txt", file);
请参阅 Bun.write()。