changeToParentDirectory method

  1. @override
void changeToParentDirectory()
override

Changes the current working directory to the parent directory. Implementations must handle path resolution and update the internal state correctly, including checks for navigating above the root.

Implementation

@override
void changeToParentDirectory() {
  if (currentDirectory == rootDirectory) {
    throw FileSystemException("Cannot navigate above root", currentDirectory);
  }
  // Calculate parent virtual directory using path package
  final parentVirtualDir = p.dirname(currentDirectory);
  // Use changeDirectory to handle the logic and state update
  changeDirectory(parentVirtualDir);
}