From 91830b8bf383b8cfdb7d9bd18895047cff820df7 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 26 Aug 2023 16:27:03 +0800 Subject: [PATCH] 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. --- lisp/files.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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. -- 2.39.5