(tramp-convert-file-attributes v localname id-format
(and
(tramp-adb-send-command-and-check
- v (format "%s -d -l %s"
+ v (format "%s -d -l %s | cat"
(tramp-adb-get-ls-command v)
(tramp-shell-quote-argument localname)))
(with-current-buffer (tramp-get-buffer v)
directory full match nosort id-format count
(with-current-buffer (tramp-get-buffer v)
(when (tramp-adb-send-command-and-check
- v (format "%s -a -l %s"
+ v (format "%s -a -l %s | cat"
(tramp-adb-get-ls-command v)
(tramp-shell-quote-argument localname)))
;; We insert also filename/. and filename/.., because "ls"
- ;; doesn't. Looks like it does include them in toybox, since
- ;; Android 6.
+ ;; doesn't on some file systems, like "sdcard".
(unless (re-search-backward "\\.$" nil t)
(narrow-to-region (point-max) (point-max))
(tramp-adb-send-command
- v (format "%s -d -a -l %s %s"
+ v (format "%s -d -a -l %s %s | cat"
(tramp-adb-get-ls-command v)
(tramp-shell-quote-argument
(tramp-compat-file-name-concat localname "."))
Android's \"ls\" command doesn't insert size column for directories:
Emacs dired can't find files."
(save-excursion
- ;; Fix file names with spaces.
- ;; FIXME: It would be better if we could call "ls" with proper
- ;; argument or environment variable.
- (replace-string-in-region "\\ " " " (point-min))
;; Insert missing size.
(goto-char (point-min))
(while
(with-parsed-tramp-file-name (expand-file-name directory) nil
(with-tramp-file-property v localname "file-name-all-completions"
(tramp-adb-send-command
- v (format "%s -a %s"
+ v (format "%s -a %s | cat"
(tramp-adb-get-ls-command v)
(tramp-shell-quote-argument localname)))
(mapcar
(with-current-buffer (tramp-get-buffer v)
(delete-dups
(append
- ;; In older Android versions, "." and ".." are not
- ;; included. In newer versions (toybox, since Android 6)
- ;; they are. We fix this by `delete-dups'.
+ ;; On some file systems like "sdcard", "." and ".." are
+ ;; not included. We fix this by `delete-dups'.
'("." "..")
(delq
nil
(file-attributes tmp-name1))))
;; Skip the test, if the remote handler is not able to set
;; the correct time.
- (skip-unless (set-file-times tmp-name1 (seconds-to-time 1)))
+ ;; Some remote machines cannot resolve seconds. So we use a minute.
+ (skip-unless (set-file-times tmp-name1 (seconds-to-time 60)))
;; Dumb remote shells without perl(1) or stat(1) are not
;; able to return the date correctly. They say "don't know".
(unless (tramp-compat-time-equal-p
(file-attributes tmp-name1))
tramp-time-dont-know)
(should
- (or (tramp-compat-time-equal-p
- (file-attribute-modification-time
- (file-attributes tmp-name1))
- (seconds-to-time 1))
- ;; Some remote machines cannot resolve seconds.
- ;; The return the modification time `(0 0).
- (tramp-compat-time-equal-p
- (file-attribute-modification-time
- (file-attributes tmp-name1))
- (seconds-to-time 0))))
+ (tramp-compat-time-equal-p
+ (file-attribute-modification-time (file-attributes tmp-name1))
+ (seconds-to-time 60)))
;; Setting the time for not existing files shall fail.
(should-error
(set-file-times tmp-name2)
;; regular files, there shouldn't be a difference.
(when (tramp--test-emacs28-p)
(with-no-warnings
- (set-file-times tmp-name1 (seconds-to-time 1) 'nofollow)
+ (set-file-times tmp-name1 (seconds-to-time 60) 'nofollow)
(should
- (or (tramp-compat-time-equal-p
- (file-attribute-modification-time
- (file-attributes tmp-name1))
- (seconds-to-time 1))
- ;; Some remote machines cannot resolve seconds.
- ;; The return the modification time `(0 0).
- (tramp-compat-time-equal-p
- (file-attribute-modification-time
- (file-attributes tmp-name1))
- (seconds-to-time 0))))))))
+ (tramp-compat-time-equal-p
+ (file-attribute-modification-time
+ (file-attributes tmp-name1))
+ (seconds-to-time 60)))))))
;; Cleanup.
(ignore-errors