將檔案複製到另一個位置
使用 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()。