diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp index f1411614b9..5afce1d11c 100644 --- a/Userland/Applications/SpaceAnalyzer/main.cpp +++ b/Userland/Applications/SpaceAnalyzer/main.cpp @@ -231,7 +231,7 @@ static void analyze(RefPtr tree, SpaceAnalyzer::TreeMapWidget& treemapwidg static bool is_removable(const String& absolute_path) { VERIFY(!absolute_path.is_empty()); - int access_result = access(absolute_path.characters(), W_OK); + int access_result = access(LexicalPath::dirname(absolute_path).characters(), W_OK); if (access_result != 0 && errno != EACCES) perror("access"); return access_result == 0;