Bizarre log file permissions

When I create a new app with the rails command, it creates a log directory. You must chmod that to 666 according to the error message I get whenever anything (like script/generate) tries to log a message. Fine ...

... But, what the hell is this about???

$ ls -la log/ ls: cannot access log/.: Permission denied ls: cannot access log/..: Permission denied ls: cannot access log/development.log: Permission denied ls: cannot access log/test.log: Permission denied ls: cannot access log/server.log: Permission denied ls: cannot access log/production.log: Permission denied total 0 ??? ? ? ? ? ? . ??? ? ? ? ? ? .. ??? ? ? ? ? ? development.log ??? ? ? ? ? ? production.log ??? ? ? ? ? ? server.log ??? ? ? ? ? ? test.log

(entries are in red and blinking)

BUT

$ sudo ls -la log/ Password: total 4 drw-rw-rw- 2 nobrow apache 168 Oct 24 20:12 . drwxr-xr-x 14 nobrow apache 392 Oct 24 20:12 .. -rw-rw-rw- 1 nobrow apache 2479 Oct 24 20:12 development.log -rw-rw-rw- 1 nobrow apache 0 Oct 24 20:12 production.log -rw-rw-rw- 1 nobrow apache 0 Oct 24 20:12 server.log -rw-rw-rw- 1 nobrow apache 0 Oct 24 20:12 test.log

I am the owner of these files so why do they not show up properly unless I list them as root? Of course the log files cant be accessed by the scripts to log messages either.

This is really bizarre.

Bash on Gentoo.

cd into the directory where the "log" directory lives.

chmod a+x log

Worked, thanks. Why? Why does the dir have to be a+x to be able to list the files? Are they not "real" files?

Same is true for tmp?