3 ms·
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 alte
by junke 10y ago
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)