From: Ryan Davis Date: 2012-10-29T07:09:56+09:00 Subject: Re: File.readable? and /proc On Oct 28, 2012, at 13:00 , Jeff Moore wrote: > It's the inconsistency with: > > root@nail:/projects/proc_fs# ls -al /proc/sys/fs/binfmt_misc/register > --w------- 1 root root 0 2012-10-28 08:24 > /proc/sys/fs/binfmt_misc/register > > that I find mostly surprising. Yeah. But that's just how root works and is both a blessing and a curse. 10000 % sudo bash 9999 % echo "blah" > blah.txt 10000 % chmod 000 blah.txt 10001 % ll blah.txt ---------- 1 root staff 5 Oct 28 14:54 blah.txt 10002 % cat blah.txt blah 10003 % ruby -e 'p File.readable? "blah.txt"' true 10004 % exit 10001 % ruby -e 'p File.readable? "blah.txt"' false So, while ls tells you the attributes on the file, root overrides all. If you made something that root couldn't get to / change / rm / read then you'd wind up with a really wonky system. For example, instant DOS: while true ; do F=$$.$(date +%s) dd if=/dev/zero of=$F bs=1g count=1 chmod 0 $F done