NodeReaper has asked for the wisdom of the Perl Monks concerning the following question:

This node was taken out by the NodeReaper on Jul 05, 2013 at 16:59 UTC

Replies are listed 'Best First'.
Re: Get File Permission
by Happy-the-monk (Canon) on Jul 05, 2013 at 14:33 UTC

    ls -le

    What is the -e switch supposedly doing?

    This gives you simple user-group-world octal permissions on all files in the current directory if you restrain from learning ls switches ;-)

    perl -e'printf("%03o $_\n",(stat("$_"))[2]&07777,$_)for glob"*"'

    All that beauty in such a simple statement... *wanders off*

    Cheers, Sören

    (hooked on the Perl Programming language)

Re: Get File Permission
by hippo (Archbishop) on Jul 05, 2013 at 14:18 UTC
    man test

    ... and just to bring it back on topic:

    perl -e 'print "Accessible!\n" if -r $ARGV[0];' filename
      Thanks for your help. Its working fine