340 |
(mapcar |
(mapcar |
341 |
(lambda (x) |
(lambda (x) |
342 |
;; We cannot call `file-attributes' for backward compatibility reasons. |
;; We cannot call `file-attributes' for backward compatibility reasons. |
343 |
;; Its optional parameter ID-FORMAT is introduced with Emacs 21.4. |
;; Its optional parameter ID-FORMAT is introduced with Emacs 22.1. |
344 |
(cons x (tramp-smb-handle-file-attributes |
(cons x (tramp-smb-handle-file-attributes |
345 |
(if full x (concat (file-name-as-directory directory) x)) id-format))) |
(if full x (concat (file-name-as-directory directory) x)) id-format))) |
346 |
(directory-files directory full match nosort))) |
(directory-files directory full match nosort))) |
347 |
|
|
348 |
(defun tramp-smb-handle-file-attributes (filename &optional id-format) |
(defun tramp-smb-handle-file-attributes (filename &optional id-format) |
349 |
"Like `file-attributes' for tramp files." |
"Like `file-attributes' for tramp files." |
350 |
; (with-parsed-tramp-file-name filename nil |
; (with-parsed-tramp-file-name filename nil |
500 |
(entries (tramp-smb-get-file-entries user host share file))) |
(entries (tramp-smb-get-file-entries user host share file))) |
501 |
|
|
502 |
;; Delete dummy "" entry, useless entries |
;; Delete dummy "" entry, useless entries |
503 |
(setq entries |
(setq entries |
504 |
(if (file-directory-p filename) |
(if (file-directory-p filename) |
505 |
(delq (assoc "" entries) entries) |
(delq (assoc "" entries) entries) |
506 |
;; We just need the only and only entry FILENAME. |
;; We just need the only and only entry FILENAME. |