bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#61708: 28.2; file-modes-symbolic-to-number inconsistency


From: Thierry Volpiatto
Subject: bug#61708: 28.2; file-modes-symbolic-to-number inconsistency
Date: Wed, 22 Feb 2023 17:44:01 +0000

Gregory Heytings <gregory@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

Attachment: signature.asc
Description: PGP signature


reply via email to

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