{"record":{"id":"d367e8393e4c9bb4","repo":"yorukot/superfile","slug":"could-not-find-a-free-trash-name-for-s","errorCode":null,"errorMessage":"could not find a free trash name for %s","messagePattern":"could not find a free trash name for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/internal/trash/trash_linux.go","lineNumber":264,"sourceCode":"\t\tfile, err := os.OpenFile(infoPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0o600)\n\t\tif os.IsExist(err) {\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", \"\", err\n\t\t}\n\t\tif _, err := file.WriteString(content); err != nil {\n\t\t\t_ = file.Close()\n\t\t\t_ = os.Remove(infoPath)\n\t\t\treturn \"\", \"\", \"\", err\n\t\t}\n\t\tif err := file.Close(); err != nil {\n\t\t\t_ = os.Remove(infoPath)\n\t\t\treturn \"\", \"\", \"\", err\n\t\t}\n\t\treturn name, infoPath, filesPath, nil\n\t}\n\treturn \"\", \"\", \"\", fmt.Errorf(\"could not find a free trash name for %s\", srcAbs)\n}\n\nfunc candidateTrashName(base string, attempt int) string {\n\tif attempt == 0 && len(base) <= maxTrashEntryNameBytes {\n\t\treturn base\n\t}\n\n\thash := trashNameHash(base)\n\tsuffix := \".\" + hash\n\tif attempt > 0 {\n\t\tsuffix = fmt.Sprintf(\".%s.%d\", hash, attempt)\n\t}\n\tprefixLimit := maxTrashEntryNameBytes - len(suffix)\n\tif prefixLimit <= 0 {\n\t\treturn suffix[len(suffix)-maxTrashEntryNameBytes:]\n\t}\n\tif len(base) > prefixLimit {\n\t\tbase = base[:prefixLimit]","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/yorukot/superfile/blob/b72f550bc6e75913f48eb49fdd258e1a2df2fe88/src/internal/trash/trash_linux.go#L246-L282","documentation":"Error \"could not find a free trash name for %s\" thrown in yorukot/superfile.","triggerScenarios":"Thrown at src/internal/trash/trash_linux.go:264 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b72f550bc6e75913f48eb49fdd258e1a2df2fe88","analyzedAt":"2026-09-01T04:38:08.254Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}