MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / cleanupTrashInfoByEntryPath

Function cleanupTrashInfoByEntryPath

agent/app/service/recycle_bin.go:445–460  ·  view source on GitHub ↗
(filePath string)

Source from the content-addressed store, hash-verified

443}
444
445func 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
462func allocateTrashEntryName(filesDir, infoDir, sourcePath string) string {
463 ext := path.Ext(path.Base(sourcePath))

Callers 3

DeleteMethod · 0.85
BatchDeleteMethod · 0.85
ReduceMethod · 0.85

Calls 3

trashInfoPathFunction · 0.85
trashInfoDirFunction · 0.85
CleanMethod · 0.65

Tested by

no test coverage detected