Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I can understand that for someone has no background or long term use of chmod(1) would need some effort to decipher what 0644 actually means. However, for people who are well versed in this aspect, the numerical code is much easier to parse.

This reminds me of constantly looking up j dict [0] before I could remember what each number means. J's foreign conjunction is certainly an extreme here, but it teaches me that what is easy to parse really depends on one's proficiency in the language.

[0] http://www.jsoftware.com/help/dictionary/dx001.htm



I've been using Unix for years and years on a variety of systems, including various sysadminy roles, and I still cannot keep the octal permission numbers in my head. My current job involves using one tool which only supports the octal and I always go to an online site which calculates them for me because otherwise I will just get them wrong.

I'd vastly prefer the symbolic forms (and am slightly surprised that the kernel source has raw octal in it at all). Although I wouldn't have tried to implement the change as a thousand separate patches...


The symbolic form is frankly unreadable and the kernel people don't need them because they probably already dream of octal permissions when asleep.

For an alternative symbolic approach, here is how it is done in Lisp, thanks to SETF (and the OSICAT library).

    (file-permissions #P"/tmp/file")
    NIL

    (setf (file-permissions #P"/tmp/file")
          '(:user-read :group-read :other-read))

    ... or

    (nix:chmod #P"/tmp/file" #o444)
By the magic of SETF, you can now use all other macros which modify a place:

    (push :user-write (file-permissions #P"/tmp/file"))
And thus:

    (file-permissions #P"/tmp/file")
    => (:USER-READ :USER-WRITE :GROUP-READ :OTHER-READ)


I'm the exact opposite - I can instantly understand what 600, 777, 664 and so on mean with barely a thought, but having used Linux for the majority of my life I still struggle to remember "chmod u+w" and whatever.


Those are different things though. "u+w" doesn't require me to know what the current permissions are, but only that I want to let the owner write.


I think what trips me up about them is that they are effectively counted backwards. RWX is 421 rather than 124.


chmod(1) man page would either contain the meaning of each number or a reference to where the definitions are on any decent Unix system.


I've been using the octal for many years, but never with any real frequency so I always have to think about it a bit more than I'd like to admit. Having said that, looking what those patches are proposing... the octal is far superior even for an interloper like myself. I know how to think about the octal permissions to get to what is happening without digging into documentation... I can't say that with the macros.

Also, just spamming like that is insane.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: