GNU bug report logs - #58446
28.2; file-attribute-device-number returns a cons cell instead of an integer

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thievol <at> posteo.net>

Date: Tue, 11 Oct 2022 18:18:02 UTC

Severity: normal

Found in version 28.2

Fixed in version 29.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #25 received at 58446 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Thierry Volpiatto <thievol <at> posteo.net>, Lars Ingebrigtsen <larsi <at> gnus.org>,
 58446 <at> debbugs.gnu.org
Subject: Re: bug#58446: 28.2; file-attribute-device-number returns a cons
 cell instead of an integer
Date: Fri, 14 Oct 2022 13:04:31 -0400
> (defsubst file-attribute-file-number (attributes)
>   "The inode and device numbers in ATTRIBUTES returned by `file-attributes'.
> It can be used to determine whether two files are identical."
>   (nthcdr 10 attributes))
>
> WDYT?

Sounds good, except:

- The name `file-attribute-file-number` doesn't sound right
  because it doesn't return a number.

- I wouldn't use `defsubst` (so it can more easily be modified in the
  future, e.g. in case we add more fields to the attributes or use some
  other representation for attributes).

- I would document it more abstractly, mentioning inode and device
  number only as *examples* of things it might contain.


        Stefan





This bug report was last modified 2 years and 299 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.