From: Po Lu Date: Sat, 26 Aug 2023 08:27:03 +0000 (+0800) Subject: Revise last change to copy-directory X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=91830b8bf383b8cfdb7d9bd18895047cff820df7;p=emacs.git Revise last change to copy-directory * lisp/files.el (copy-directory): Instead of demoting errors from set-file-times, refrain from setting them if newname is located within /contents. --- diff --git a/lisp/files.el b/lisp/files.el index a015dd3cf4d..4188615e490 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6623,10 +6623,14 @@ into NEWNAME instead." (follow-flag (unless follow 'nofollow))) (if modes (set-file-modes newname modes follow-flag)) (when times - ;; Don't didactically fail if file times can't be set, as - ;; some file systems forbid modifying them. - (with-demoted-errors "Setting file times: %s" - (set-file-times newname times follow-flag)))))))) + ;; When built for an Android GUI build, don't attempt to + ;; set file times for a file within /content, as the + ;; Android VFS layer does not provide means to change file + ;; timestamps. + (when (or (not (and (eq system-type 'android) + (featurep 'android))) + (not (string-prefix-p "/content/" newname))) + (set-file-times newname times follow-flag)))))))) ;; At time of writing, only info uses this.