yorukot/superfile · error

invalid trash source %s

Error message

invalid trash source %s

What it means

Error "invalid trash source %s" thrown in yorukot/superfile.

Source

Thrown at src/internal/trash/trash_linux.go:227

		if err := os.Chmod(path, 0o700); err != nil {
			return fmt.Errorf("failed to restrict trash directory %s: %w", path, err)
		}
	}
	return nil
}

func validSharedTrash(path string) bool {
	info, err := os.Lstat(path)
	if err != nil || !info.IsDir() || info.Mode()&os.ModeSymlink != 0 {
		return false
	}
	return info.Mode()&os.ModeSticky != 0
}

func reserveTrashInfo(td linuxTrashDir, srcAbs string) (string, string, string, error) {
	base := filepath.Base(srcAbs)
	if base == "." || base == string(filepath.Separator) || base == "" {
		return "", "", "", fmt.Errorf("invalid trash source %s", srcAbs)
	}
	escapedPath, err := trashInfoPath(td, srcAbs)
	if err != nil {
		return "", "", "", err
	}
	deletionDate := time.Now().Format(trashInfoDateLayout)
	content := "[Trash Info]\nPath=" + escapedPath + "\nDeletionDate=" + deletionDate + "\n"

	for i := range 10_000 {
		name := candidateTrashName(base, i)
		infoPath := filepath.Join(td.info, name+trashInfoSuffix)
		filesPath := filepath.Join(td.files, name)
		if _, err := os.Lstat(filesPath); err == nil {
			continue
		} else if !os.IsNotExist(err) {
			return "", "", "", err
		}

View on GitHub (pinned to b72f550bc6)

When it happens

Trigger: Thrown at src/internal/trash/trash_linux.go:227 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of yorukot/superfile@b72f550bc6 (2026-09-01). Data as JSON: /api/errors/d49e9cfcbdcdf236. Report an issue: GitHub.