{"record":{"id":"9d55e12cbc94a02d","repo":"yorukot/superfile","slug":"cannot-paste-into-parent-directory-of-source-srcp","errorCode":null,"errorMessage":"cannot paste into parent directory of source, srcPath : %v, panelLocation : %v","messagePattern":"cannot paste into parent directory of source, srcPath : (.+?), panelLocation : (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/internal/handle_file_operations.go","lineNumber":297,"sourceCode":"\n\tslog.Debug(\"Submitting pasteItems request\", \"id\", reqID, \"items cnt\", len(copyItems), \"dest\", panelLocation)\n\treturn func() tea.Msg {\n\t\terr := validatePasteOperation(panelLocation, copyItems, cut)\n\t\tif err != nil {\n\t\t\treturn NewNotifyModalMsg(notify.New(true, \"Invalid paste location\", err.Error(), notify.NoAction),\n\t\t\t\treqID)\n\t\t}\n\t\treturn m.executePasteOperation(&m.processBarModel, panelLocation, copyItems, cut, reqID)\n\t}\n}\n\nfunc validatePasteOperation(panelLocation string, copyItems []string, cut bool) error {\n\t// Check if trying to paste into source or subdirectory for both cut and copy operations\n\tfor _, srcPath := range copyItems {\n\t\t// Check if trying to cut and paste into the same directory - this would be a no-op\n\t\t// and could potentially cause issues, so we prevent it\n\t\tif filepath.Dir(srcPath) == panelLocation && cut {\n\t\t\treturn fmt.Errorf(\"cannot paste into parent directory of source, srcPath : %v, panelLocation : %v\",\n\t\t\t\tsrcPath, panelLocation)\n\t\t}\n\t\tif cut && srcPath == panelLocation {\n\t\t\treturn errors.New(\"cannot paste a directory into itself\")\n\t\t}\n\n\t\tif isAncestor(srcPath, panelLocation) {\n\t\t\treturn fmt.Errorf(\"cannot %s and paste a directory into itself or its subdirectory\",\n\t\t\t\tgetCopyOrCutOperationName(cut))\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc makePasteProcessor(process processbar.Process,\n\tprocessBarModel *processbar.Model,\n\tpanelLocation string, cut bool,","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/yorukot/superfile/blob/b72f550bc6e75913f48eb49fdd258e1a2df2fe88/src/internal/handle_file_operations.go#L279-L315","documentation":"Error \"cannot paste into parent directory of source, srcPath : %v, panelLocation : %v\" thrown in yorukot/superfile.","triggerScenarios":"Thrown at src/internal/handle_file_operations.go:297 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"}