GNU bug report logs - #61708
28.2; file-modes-symbolic-to-number inconsistency

Previous Next

Package: emacs;

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

Date: Wed, 22 Feb 2023 13:59:02 UTC

Severity: normal

Found in version 28.2

Full log


View this message in rfc822 format

From: Thierry Volpiatto <thievol <at> posteo.net>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: Andreas Schwab <schwab <at> suse.de>, 61708 <at> debbugs.gnu.org
Subject: bug#61708: 28.2; file-modes-symbolic-to-number inconsistency
Date: Wed, 22 Feb 2023 17:44:01 +0000
[Message part 1 (text/plain, inline)]
Gregory Heytings <gregory <at> heytings.org> writes:

>>
>> How one convert the output of (nth 8 (file-attributes "/home/user"))
>> to numeric mode?
>>
>
> (file-modes "/home/user")

Yes, thanks I know this one, what I want to convert is e.g. "-rwxr-x---"
to number.

(file-modes-number-to-symbolic #o750)
"-rwxr-x---"
Means
"-|rwx|r-x|---"
rwx for user, rx for group and nothing for others.

What I mean is that file-modes-symbolic-to-number returns the right
value with MODES "u=rwx,g=rx,o=" but the wrong value with
"u=rwx,g=r-x,o=---".
This is why read-file-modes remove the "-" for passing the string as
MODES to file-modes-symbolic-to-number.

So shouldn't file-modes-symbolic-to-number supports "u=rwx,g=r-x,o=---"
and "u=rwx,g=rx,o=" in the same way.

I ask because I had to read code to understand this as I can't
understand the docstring.

-- 
Thierry
[signature.asc (application/pgp-signature, inline)]

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

Previous Next


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