]> git.eshelyaron.com Git - emacs.git/commitdiff
Revise last change to copy-directory
authorPo Lu <luangruo@yahoo.com>
Sat, 26 Aug 2023 08:27:03 +0000 (16:27 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 26 Aug 2023 08:37:31 +0000 (16:37 +0800)
* 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

index a015dd3cf4dec8304b7f114c2a01119c9af87e45..4188615e490f9258daf4ec3036e430c8540924d7 100644 (file)
@@ -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))))))))
 
 \f
 ;; At time of writing, only info uses this.