刪除檔案
要刪除檔案,請使用 Bun.file(path).delete()。
// 刪除檔案
const file = Bun.file("path/to/file.txt");
await file.delete();
// 現在該檔案不存在了
const exists = await file.exists();
// => false
請參閱檔案 I/O以瞭解更多檔案系統操作。
要刪除檔案,請使用 Bun.file(path).delete()。
// 刪除檔案
const file = Bun.file("path/to/file.txt");
await file.delete();
// 現在該檔案不存在了
const exists = await file.exists();
// => false
請參閱檔案 I/O以瞭解更多檔案系統操作。