yorukot/superfile · error

%s is not a directory

Error message

%s is not a directory

What it means

Error "%s is not a directory" thrown in yorukot/superfile.

Source

Thrown at src/internal/ui/filepanel/update.go:45

	// In case non Absolute path is passed, make sure to resolve it.
	path = utils.ResolveAbsPath(m.Location, path)

	// Ignore if its the same directory. It prevents resetting of searchBar
	if path == m.Location {
		return nil
	}

	// NOTE: This could be a configurable feature
	// Update the cursor and render status in case we switch back to this.
	m.DirectoryRecords[m.Location] = directoryRecord{
		directoryCursor: m.cursor,
		directoryRender: m.renderIndex,
	}

	if info, err := os.Stat(path); err != nil {
		return fmt.Errorf("%s : no such file or directory, stats err : %w", path, err)
	} else if !info.IsDir() {
		return fmt.Errorf("%s is not a directory", path)
	}

	// In case of switching to parent, explicitly set focus.
	// This is to handle when there isn't a DirectoryRecord, yet.
	if filepath.Dir(m.Location) == path {
		m.TargetFile = filepath.Base(m.Location)
	}
	// Switch to "path"
	m.Location = path

	// NOTE: We are fetching the cursor and render from cache, but this could become invalid
	// in case user deletes some items in the directory via another file manager and then switch back
	// Basically this directoryRecords cache can be invalid. On each Update(), on dire change
	// we do a element fetch and validate the cursor and render values. But the filepane could
	// stay in invalid state till that and operations done before the update may fail
	curDirectoryRecord, hasRecord := m.DirectoryRecords[m.Location]
	if hasRecord {
		m.cursor = curDirectoryRecord.directoryCursor

View on GitHub (pinned to b72f550bc6)

When it happens

Trigger: Thrown at src/internal/ui/filepanel/update.go:45 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/730406d2e8b357a5. Report an issue: GitHub.