(filePath string)
| 443 | } |
| 444 | |
| 445 | func cleanupTrashInfoByEntryPath(filePath string) error { |
| 446 | cleaned := path.Clean(filePath) |
| 447 | parent := path.Dir(cleaned) |
| 448 | if path.Base(parent) != recycleBinFilesSubdir { |
| 449 | return nil |
| 450 | } |
| 451 | clashRoot := path.Dir(parent) |
| 452 | if path.Base(clashRoot) != recycleBinClashDir { |
| 453 | return nil |
| 454 | } |
| 455 | infoPath := trashInfoPath(trashInfoDir(clashRoot), path.Base(cleaned)) |
| 456 | if err := os.Remove(infoPath); err != nil && !os.IsNotExist(err) { |
| 457 | return err |
| 458 | } |
| 459 | return nil |
| 460 | } |
| 461 | |
| 462 | func allocateTrashEntryName(filesDir, infoDir, sourcePath string) string { |
| 463 | ext := path.Ext(path.Base(sourcePath)) |
no test coverage detected