3 ms·
Damn! I’m guessing most developers today wouldn’t even know octal or how octal numeric literals are written with a “0” prefix. I actually laughed when I read th
by AnonC 3y ago
Damn! I’m guessing most developers today wouldn’t even know octal or how octal numeric literals are written with a “0” prefix. I actually laughed when I read this comment, but this behavior (and assumption) is ridiculous considering the fact that almost nobody would be using octal in some configuration file in 2023. Hexadecimal? Maybe. Decimal? Yes. Octal? C’mon!
- baz00 3y agoActually I'd like to use octal. 0777 for example. But fuck this particular type conversion semantic.
- oblio 3y agoJust switch to ugo / +- / rwx, much more intuitive.
- heelix 3y agoWhich - seeing like that, were the Linux file permissions originally octal? When thinking about permissions and permutations... and old magic numbers, that seems like the bits might fit.
- baz00 3y agoWell they were grouped in blocks of 3 bits so octal is a good representational format for 3 bits.
- itsthejb 3y agoOctal is very commonly used in Ansible playbooks, for representing file permissions
- tagirb 3y agoExactly there I was hit so many times by not using quotes around file permissions, because 0644 is interpreted as 420 and Ansible sets the permissions to '-r---w----' instead of '-rw-r--r--'. Here's a relevant suggestion from the Ansible docs (https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html#parameter-mode https://docs.ansible.com/ansible/latest/collections/ansible/...): For those used to /usr/bin/chmod remember that modes are actually octal numbers. You must give Ansible enough information to parse them correctly. For consistent results, quote octal numbers (for example, '644' or '1777') so Ansible receives a string and can do its own conversion from string into number. Adding a leading zero (for example, 0755) works sometimes, but can fail in loops and some other circumstances.
- tagirb 3y agoDespite this, I still think YAML is a nice configuration language. The problem is not with YAML, it's with the whole complexity we're trying to represent there. Whatever configuration language you use, the outcome will be the same. Reduce the complexity, and it will shine.
- lifehasleft 3y agoOh my god I think you solved a work problem I was recently having