emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file-equal-p


From: Eli Zaretskii
Subject: Re: file-equal-p
Date: Fri, 17 Feb 2023 10:32:37 +0200

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Fri, 17 Feb 2023 15:07:20 +0800
> 
> Anyway, how's this:
> 
> diff --git a/lisp/files.el b/lisp/files.el
> index b0ec6bb09d0..5b989902bc3 100644
> --- a/lisp/files.el
> +++ b/lisp/files.el
> @@ -6360,7 +6360,18 @@ file-equal-p
>        (let (f1-attr f2-attr)
>          (and (setq f1-attr (file-attributes (file-truename file1)))
>            (setq f2-attr (file-attributes (file-truename file2)))
> -          (equal f1-attr f2-attr))))))
> +             (progn
> +               ;; Haiku systems change the file's last access timestamp
> +               ;; every time `stat' is called.  Make sure to not compare
> +               ;; the timestamps in that case.
> +               (or (equal f1-attr f2-attr)
> +                   (when (and (eq system-type 'haiku)
> +                              (consp (nthcdr 4 f1-attr))
> +                              (consp (nthcdr 4 f2-attr)))
> +                     (ignore-errors
> +                       (setcar (nthcdr 4 f1-attr) nil)
> +                       (setcar (nthcdr 4 f2-attr) nil))
> +                  (equal f1-attr f2-attr)))))))))
>  
>  (defun file-in-directory-p (file dir)
>    "Return non-nil if DIR is a parent directory of FILE.

Fine by me, thanks.

This can go to the emacs-29 branch, if you want.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]