此程式碼片段將檔案複製到磁碟上的其他位置。
它使用快速的 Bun.write()
API 來有效率地將資料寫入磁碟。第一個參數是目的地,例如絕對路徑或 BunFile
實例。第二個參數是要寫入的資料。
const file = Bun.file("/path/to/original.txt");
await Bun.write("/path/to/copy.txt", file);
請參閱 文件 > API > 檔案 I/O 以取得 Bun.write()
的完整文件。
此程式碼片段將檔案複製到磁碟上的其他位置。
它使用快速的 Bun.write()
API 來有效率地將資料寫入磁碟。第一個參數是目的地,例如絕對路徑或 BunFile
實例。第二個參數是要寫入的資料。
const file = Bun.file("/path/to/original.txt");
await Bun.write("/path/to/copy.txt", file);
請參閱 文件 > API > 檔案 I/O 以取得 Bun.write()
的完整文件。
HTTP
程序
讀取檔案
執行時期
公用程式
WebSocket