I'm porting a program from Linux and Windows to macOS, and we use /usr/tmp
, I can switch to /usr/local
, but it puzzles me why not root can create a directory there that I can chown
and use with my program.
$ sudo whoami
root
$ whoami
mobj
$ sudo mkdir /usr/tmp
mkdir: /usr/tmp: Operation not permitted
$ ls -ld /usr/
drwxr-xr-x@ 11 root wheel 352 Nov 2 23:44 /usr/
$ sudo mkdir /usr/local/tmp
$ sudo chown mobj:dist /usr/local/tmp
$ ls -ld /usr/local/tmp
drwxr-xr-x 2 mobj dist 64 Nov 23 12:07 /usr/local/tmp