Function: tramp-do-parse-file-attributes-with-ls

tramp-do-parse-file-attributes-with-ls is a byte-compiled function defined in tramp-adb.el.gz.

Signature

(tramp-do-parse-file-attributes-with-ls VEC)

Documentation

Parse file-attributes for Tramp files using the ls(1) command.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-adb.el.gz
(defun tramp-do-parse-file-attributes-with-ls (vec)
  "Parse `file-attributes' for Tramp files using the ls(1) command."
  (with-current-buffer (tramp-get-buffer vec)
    (goto-char (point-min))
    (let (file-properties)
      (while (search-forward-regexp tramp-adb-ls-toolbox-regexp nil t)
	(let* ((mod-string (match-string 1))
	       (is-dir (eq ?d (aref mod-string 0)))
	       (is-symlink (eq ?l (aref mod-string 0)))
	       (uid (match-string 2))
	       (gid (match-string 3))
	       (size (string-to-number (match-string 4)))
	       (date (match-string 5))
	       (name (match-string 6))
	       (symlink-target
		(and is-symlink
		     (cadr (split-string name (rx (| " -> " "\n")))))))
	  (push (list
		 (if is-symlink
		     (car (split-string name (rx (| " -> " "\n"))))
		   name)
		 (or is-dir symlink-target)
		 1     ;link-count
		 ;; no way to handle numeric ids in Androids ash
		 (cons uid tramp-unknown-id-integer)
		 (cons gid tramp-unknown-id-integer)
		 tramp-time-dont-know   ; atime
		 ;; `date-to-time' checks `iso8601-parse', which might fail.
		 (let (signal-hook-function)
		   (date-to-time date))	; mtime
		 tramp-time-dont-know   ; ctime
		 size
		 mod-string
		 ;; fake
		 t 1
		 (tramp-get-device vec))
		file-properties)))
      file-properties)))