From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 349798a9b8: Demote errors from utimensat copying directories Date: Sat, 26 Aug 2023 10:38:39 +0300 Message-ID: <835y52meww.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26681"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, Paul Eggert To: Po Lu , Bruno Haible Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 26 09:39:13 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qZnt2-0006iP-UZ for ged-emacs-devel@m.gmane-mx.org; Sat, 26 Aug 2023 09:39:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZns7-0003eP-95; Sat, 26 Aug 2023 03:38:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZns5-0003bV-Aw for emacs-devel@gnu.org; Sat, 26 Aug 2023 03:38:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZns2-0000rG-ST; Sat, 26 Aug 2023 03:38:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to: references; bh=sfJILUBdU8polnqH8wE7kfnSmlBr6Bolu0ESZEYCMvM=; b=hHWkOIqhgKlX/r MHMn1Ygf+eOqoQs6S/uBDfzuNZK9PzYCXy0mbKONFrxGBwXcIqytqbXWD3yjJoQPQplWlJL3bGgV7 +RBUrM3NeHCvyrPnrlESGbeV5amQGVFIZRl8fWNFy59ZIuuAa6Oqe3jmwz5v0tkNBv+exEhqjGzvW VFmRTm+6VLQuJ4s/xYLWolNvFWGKrb1/0tR2A1ielZaTWlLPqQL0pHCQ2XbPX/ro1PXq1DvGgF7V7 yAnIKB6ucW9bNNw0A+ZHXqNvCtCmHYGAx/eJILCn0PlhwXa0ztU4ewMylS8IKDBK0rYsbtI577NBd 8pOpgfwB1R4LuCzOueLA==; X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:309235 Archived-At: > diff --git a/lisp/files.el b/lisp/files.el > index 1803eb9..a015dd3 100644 > --- a/lisp/files.el > +++ b/lisp/files.el > @@ -6622,7 +6622,11 @@ copy-directory > (file-attributes directory)))) > (follow-flag (unless follow 'nofollow))) > (if modes (set-file-modes newname modes follow-flag)) > - (if times (set-file-times newname times 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)))))))) I think we should only demote these errors on Android, not on other systems. Setting correct file times when copying/modifying files is an important feature, and users should be alerted when it somehow fails, unless the failure is expected. And it only is expected on Android, AFAIU. Alternatively, the Gnulib folks (CC'd) should modify their fdutimens replacement to return ENOSYS/ENOTSUP on Android filesystems.