Commit cd63f32
committed
fix: 修复 Files.move 时的 FileAlreadyExistsException
在 Android 虚拟化环境(如 Fold Craft Launcher)中,文件系统操作可能存在延迟。
虽然代码在移动前尝试删除目标文件,但 Files.move() 仍可能因文件系统缓存
而抛出 FileAlreadyExistsException。
添加 StandardCopyOption.REPLACE_EXISTING 选项作为保底方案,确保移动操作
能够正确覆盖目标文件。
修复日志中的错误:
FileAlreadyExistsException: .../options.txt1 parent 72864ca commit cd63f32
1 file changed
Lines changed: 3 additions & 2 deletions
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
532 | 533 | | |
533 | 534 | | |
534 | 535 | | |
535 | | - | |
| 536 | + | |
536 | 537 | | |
537 | 538 | | |
538 | 539 | | |
| |||
585 | 586 | | |
586 | 587 | | |
587 | 588 | | |
588 | | - | |
| 589 | + | |
589 | 590 | | |
590 | 591 | | |
591 | 592 | | |
| |||
0 commit comments