MirOS Manual: filetest(3p)


filetest(3p)    Perl Programmers Reference Guide     filetest(3p)

NAME

     filetest - Perl pragma to control the filetest permission
     operators

SYNOPSIS

         $can_perhaps_read = -r "file";      # use the mode bits
         {
             use filetest 'access';          # intuit harder
             $can_really_read = -r "file";
         }
         $can_perhaps_read = -r "file";      # use the mode bits again

DESCRIPTION

     This pragma tells the compiler to change the behaviour of
     the filetest permission operators, "-r" "-w" "-x" "-R" "-W"
     "-X" (see perlfunc).

     The default behaviour is to use the mode bits as returned by
     the stat() family of calls.  This, however, may not be the
     right thing to do if for example various ACL (access control
     lists) schemes are in use. For such environments, "use
     filetest" may help the permission operators to return
     results more consistent with other tools.

     Each "use filetest" or "no filetest" affects statements to
     the end of the enclosing block.

     There may be a slight performance decrease in the filetests
     when "use filetest" is in effect, because in some systems
     the extended functionality needs to be emulated.

     NOTE: using the file tests for security purposes is a lost
     cause from the start: there is a window open for race condi-
     tions (who is to say that the permissions will not change
     between the test and the real operation?).  Therefore if you
     are serious about security, just try the real operation and
     test for its success - think in terms of atomic operations.

     subpragma access

     Currently only one subpragma, "access" is implemented.  It
     enables (or disables) the use of access() or similar system
     calls.  This extended filetest functionality is used only
     when the argument of the operators is a filename, not when
     it is a filehandle.

perl v5.8.8                2005-02-05                           1

Generated on 2014-07-04 21:17:45 by $MirOS: src/scripts/roff2htm,v 1.79 2014/02/10 00:36:11 tg Exp $

These manual pages and other documentation are copyrighted by their respective writers; their source is available at our CVSweb, AnonCVS, and other mirrors. The rest is Copyright © 2002‒2014 The MirOS Project, Germany.
This product includes material provided by Thorsten Glaser.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.