in reply to Re^7: perl file status and sudo
in thread perl file status and sudo
I think he means situations where he is denied read access to a directory:
$ echo $EUID 1000 $ ls -ld /var/log/apache2 drwxr-x--- 2 root adm 12288 Mar 18 06:25 /var/log/apache2 $ ls -l /var/log/apache2 ls: cannot open directory /var/log/apache2: Permission denied $ perl -E 'say ((-e q-/var/log/apache2/access.log-) ? "exists" : "not +exists: $!")' not exists: Permission denied # echo $EUID 0 # perl -E 'say ((-e q-/var/log/apache2/access.log-) ? "exists" : "not +exists: $!")' exists
He probably just should examine $!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: perl file status and sudo
by JavaFan (Canon) on Mar 22, 2012 at 22:20 UTC | |
by aaron_baugher (Curate) on Mar 23, 2012 at 01:56 UTC | |
by JavaFan (Canon) on Mar 23, 2012 at 08:44 UTC |