2026/4/18小於 1 分鐘
renameFile
重新命名檔案。
語法
renameFile(oldPath: string, newPath: string): void參數
| 參數名稱 | 類型 | 說明 |
|---|---|---|
oldPath | string | 要重新命名的檔案路徑 |
newPath | string | 新的檔案路徑 |
// 這將把 old-file.txt 重新命名為 new-file.txt
FilesJS.renameFile('old-file.txt', 'new-file.txt');