From 16a7d760e955b71d52e544dea73597e179cc49a4 Mon Sep 17 00:00:00 2001 From: cage Date: Fri, 28 Jan 2022 15:56:12 +0100 Subject: [PATCH] - [kami] when downloading file, strips directories from remote paths. --- src/filesystem-tree-window.lisp | 4 +++- src/kami/client.lisp | 2 +- src/ui-goodies.lisp | 14 +++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/filesystem-tree-window.lisp b/src/filesystem-tree-window.lisp index 773d214..d900af5 100644 --- a/src/filesystem-tree-window.lisp +++ b/src/filesystem-tree-window.lisp @@ -416,6 +416,7 @@ (destination-file (make-temporary-file-from-path remote-path))) (when-let* ((root-node (filesystem-root window)) (matching-node (find-node root-node remote-path))) + (fs:create-file destination-file) (funcall (filesystem-download-function window) matching-node destination-file))) (defun upload-treenode (window source-file remote-path) @@ -551,7 +552,8 @@ (let* ((type (filesystem-query-treenode window a :type))) - (eq type :directory))) + (or (null type) + (eq type :directory)))) all-children))) (remove-if-not (lambda (a) (fs:filename-pattern-match path-pattern a)) all-files)))) diff --git a/src/kami/client.lisp b/src/kami/client.lisp index 7a57fe4..0c16233 100644 --- a/src/kami/client.lisp +++ b/src/kami/client.lisp @@ -142,7 +142,7 @@ (let* ((*stream* stream) (*root-fid* root-fid)) (with-cloned-root-fid (*stream* root-fid) - (a:when-let ((stat-entry (9p:path-exists-p *stream* root-fid path))) + (a:when-let ((stat-entry (9p:path-info *stream* root-fid path))) (ecase what (:type (9p:stat-entry-type stat-entry)) diff --git a/src/ui-goodies.lisp b/src/ui-goodies.lisp index acc7715..c9d73ce 100644 --- a/src/ui-goodies.lisp +++ b/src/ui-goodies.lisp @@ -2524,11 +2524,11 @@ printed, on the main window." (if (fs:extension-dir-p source-pattern) (error-message (format nil "~a is a directory" source-pattern)) (with-enqueued-process () - (let* ((remote-files (filesystem-tree-window:filter-node-children win - source-pattern)) + (let* ((remote-files (fstree:filter-node-children win + source-pattern)) (local-files (mapcar (lambda (a) (fs:append-file-to-path local-dir - a)) + (fs:path-last-element a))) remote-files))) (if (null remote-files) (error-message (format nil @@ -2712,18 +2712,18 @@ if the selected item represents a directory." (path (fstree:tree-path fields)) (size (fstree:filesystem-query-treenode win path :size-string)) (permissions (fstree:filesystem-query-treenode win path :permissions-string)) - (entry-type (symbol-name (fstree:filesystem-query-treenode win path :type))) + (entry-type (fstree:filesystem-query-treenode win path :type)) (bg (swconf:win-bg swconf:+key-help-dialog+)) (fg (swconf:win-fg swconf:+key-help-dialog+))) (windows:make-blocking-message-dialog *main-window* nil (format nil (_ "Details of: ~a") path) (list (_ "Type") - entry-type + (to-s entry-type) (_ "Size") - size + (to-s size) (_ "Permissions") - permissions) + (to-s permissions)) bg fg)))