$47 GRAYBYTE WORDPRESS FILE MANAGER $27

SERVER : in-mum-web1330.main-hosting.eu #1 SMP Mon Feb 10 22:45:17 UTC 2025
SERVER IP : 2.57.91.130 | ADMIN IP 216.73.216.215
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/share/perl5/

HOME
Current File : /usr/share/perl5//filetest.pm
package filetest;

our $VERSION = '1.03';

=head1 NAME

filetest - Perl pragma to control the filetest permission operators

=head1 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

=head1 DESCRIPTION

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

The default behaviour of file test operators is to use the simple
mode bits as returned by the stat() family of system calls.  However,
many operating systems have additional features to define more complex
access rights, for example ACLs (Access Control Lists).
For such environments, C<use filetest> may help the permission
operators to return results more consistent with other tools.

The C<use filetest> or C<no filetest> statements affect file tests defined in
their block, up to the end of the closest enclosing block (they are lexically
block-scoped).

Currently, only the C<access> sub-pragma is implemented.  It enables (or
disables) the use of access() when available, that is, on most UNIX systems and
other POSIX environments.  See details below.

=head2 Consider this carefully

The stat() mode bits are probably right for most of the files and
directories found on your system, because few people want to use the
additional features offered by access(). But you may encounter surprises
if your program runs on a system that uses ACLs, since the stat()
information won't reflect the actual permissions.

There may be a slight performance decrease in the filetest operations
when the filetest pragma is in effect, because checking bits is very
cheap.

Also, note that using the file tests for security purposes is a lost cause
from the start: there is a window open for race conditions (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.  Filetests are more useful for filesystem administrative
tasks, when you have no need for the content of the elements on disk.

=head2 The "access" sub-pragma

UNIX and POSIX systems provide an abstract access() operating system call,
which should be used to query the read, write, and execute rights. This
function hides various distinct approaches in additional operating system
specific security features, like Access Control Lists (ACLs)

The extended filetest functionality is used by Perl only when the argument
of the operators is a filename, not when it is a filehandle.

=head2 Limitation with regard to C<_>

Because access() does not invoke stat() (at least not in a way visible
to Perl), B<the stat result cache "_" is not set>.  This means that the
outcome of the following two tests is different.  The first has the stat
bits of F</etc/passwd> in C<_>, and in the second case this still
contains the bits of C</etc>.

 { -d '/etc';
   -w '/etc/passwd';
   print -f _ ? 'Yes' : 'No';   # Yes
 }

 { use filetest 'access';
   -d '/etc';
   -w '/etc/passwd';
   print -f _ ? 'Yes' : 'No';   # No
 }

Of course, unless your OS does not implement access(), in which case the
pragma is simply ignored.  Best not to use C<_> at all in a file where
the filetest pragma is active!

As a side effect, as C<_> doesn't work, stacked filetest operators
(C<-f -w $file>) won't work either.

This limitation might be removed in a future version of perl.

=cut

$filetest::hint_bits = 0x00400000; # HINT_FILETEST_ACCESS

sub import {
    if ( $_[1] eq 'access' ) {
	$^H |= $filetest::hint_bits;
    } else {
	die "filetest: the only implemented subpragma is 'access'.\n";
    }
}

sub unimport {
    if ( $_[1] eq 'access' ) {
	$^H &= ~$filetest::hint_bits;
    } else {
	die "filetest: the only implemented subpragma is 'access'.\n";
    }
}

1;

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
15 Mar 2026 11.23 AM
root / root
0755
B
--
25 Jan 2024 4.24 PM
root / root
0755
Class
--
25 Jan 2024 4.24 PM
root / root
0755
Config
--
25 Jan 2024 4.24 PM
root / root
0755
DBM_Filter
--
25 Jan 2024 4.24 PM
root / root
0755
ExtUtils
--
25 Jan 2024 4.24 PM
root / root
0755
File
--
25 Jan 2024 4.24 PM
root / root
0755
Getopt
--
25 Jan 2024 4.24 PM
root / root
0755
I18N
--
25 Jan 2024 4.24 PM
root / root
0755
IPC
--
25 Jan 2024 4.24 PM
root / root
0755
Math
--
25 Jan 2024 5.01 PM
root / root
0755
Net
--
25 Jan 2024 4.24 PM
root / root
0755
Pod
--
25 Jan 2024 4.24 PM
root / root
0755
Search
--
25 Jan 2024 4.24 PM
root / root
0755
Term
--
25 Jan 2024 4.24 PM
root / root
0755
Text
--
25 Jan 2024 4.24 PM
root / root
0755
Thread
--
25 Jan 2024 4.24 PM
root / root
0755
Tie
--
25 Jan 2024 4.24 PM
root / root
0755
Time
--
25 Jan 2024 4.24 PM
root / root
0755
URI
--
25 Jan 2024 2.16 PM
root / root
0755
Unicode
--
25 Jan 2024 4.24 PM
root / root
0755
User
--
25 Jan 2024 4.24 PM
root / root
0755
encoding
--
25 Jan 2024 4.24 PM
root / root
0755
overload
--
25 Jan 2024 4.24 PM
root / root
0755
pod
--
25 Jan 2024 4.24 PM
root / root
0755
unicore
--
25 Jan 2024 4.24 PM
root / root
0755
vendor_perl
--
28 Feb 2025 12.46 AM
root / root
0755
warnings
--
25 Jan 2024 4.24 PM
root / root
0755
AnyDBM_File.pm
2.557 KB
18 May 2023 9.34 PM
root / root
0644
AutoLoader.pm
15.427 KB
18 May 2023 9.34 PM
root / root
0644
AutoSplit.pm
19.177 KB
18 May 2023 9.34 PM
root / root
0644
Benchmark.pm
30.298 KB
18 May 2023 9.34 PM
root / root
0644
CORE.pod
3.113 KB
18 May 2023 9.34 PM
root / root
0644
DB.pm
18.479 KB
18 May 2023 9.34 PM
root / root
0644
DBM_Filter.pm
14.048 KB
18 May 2023 9.34 PM
root / root
0644
DirHandle.pm
1.52 KB
18 May 2023 9.34 PM
root / root
0644
Dumpvalue.pm
17.145 KB
18 May 2023 9.34 PM
root / root
0644
English.pm
4.649 KB
18 May 2023 9.34 PM
root / root
0644
FileCache.pm
5.441 KB
18 May 2023 9.34 PM
root / root
0644
FileHandle.pm
6.625 KB
18 May 2023 9.34 PM
root / root
0644
FindBin.pm
4.454 KB
18 May 2023 9.34 PM
root / root
0644
Internals.pod
2.516 KB
18 May 2023 9.34 PM
root / root
0644
NEXT.pm
18.404 KB
18 May 2023 9.34 PM
root / root
0644
PerlIO.pm
10.214 KB
18 May 2023 9.34 PM
root / root
0644
Safe.pm
24.494 KB
18 May 2023 9.34 PM
root / root
0644
SelectSaver.pm
1.051 KB
18 May 2023 9.34 PM
root / root
0644
Symbol.pm
4.687 KB
18 May 2023 9.34 PM
root / root
0644
Thread.pm
8.093 KB
18 May 2023 9.34 PM
root / root
0644
UNIVERSAL.pm
6.439 KB
18 May 2023 9.34 PM
root / root
0644
URI.pm
33.975 KB
9 Jan 2018 6.42 AM
root / root
0644
XSLoader.pm
11.003 KB
18 May 2023 9.34 PM
root / root
0644
_charnames.pm
32.389 KB
18 May 2023 9.34 PM
root / root
0644
autouse.pm
4.139 KB
18 May 2023 9.34 PM
root / root
0644
base.pm
10.723 KB
18 May 2023 9.34 PM
root / root
0644
blib.pm
2.037 KB
18 May 2023 9.34 PM
root / root
0644
bytes.pm
3.666 KB
18 May 2023 9.34 PM
root / root
0644
bytes_heavy.pl
0.74 KB
18 May 2023 9.34 PM
root / root
0644
charnames.pm
20.378 KB
18 May 2023 9.34 PM
root / root
0644
deprecate.pm
3.007 KB
18 May 2023 9.34 PM
root / root
0644
diagnostics.pm
18.592 KB
18 May 2023 9.34 PM
root / root
0644
dumpvar.pl
15.19 KB
18 May 2023 9.34 PM
root / root
0644
feature.pm
16.685 KB
18 May 2023 9.34 PM
root / root
0644
fields.pm
9.267 KB
18 May 2023 9.34 PM
root / root
0644
filetest.pm
3.909 KB
18 May 2023 9.34 PM
root / root
0644
if.pm
3.262 KB
18 May 2023 9.34 PM
root / root
0644
integer.pm
3.178 KB
18 May 2023 9.34 PM
root / root
0644
less.pm
3.129 KB
18 May 2023 9.34 PM
root / root
0644
locale.pm
4.741 KB
18 May 2023 9.34 PM
root / root
0644
meta_notation.pm
2.067 KB
18 May 2023 9.34 PM
root / root
0644
overload.pm
52.064 KB
18 May 2023 9.34 PM
root / root
0644
overloading.pm
1.766 KB
18 May 2023 9.34 PM
root / root
0644
perl5db.pl
309.004 KB
18 May 2023 9.34 PM
root / root
0644
sigtrap.pm
7.428 KB
18 May 2023 9.34 PM
root / root
0644
sort.pm
5.938 KB
18 May 2023 9.34 PM
root / root
0644
strict.pm
4.627 KB
18 May 2023 9.34 PM
root / root
0644
subs.pm
0.828 KB
18 May 2023 9.34 PM
root / root
0644
utf8.pm
8.902 KB
18 May 2023 9.34 PM
root / root
0644
utf8_heavy.pl
30.874 KB
18 May 2023 9.34 PM
root / root
0644
vars.pm
2.357 KB
18 May 2023 9.34 PM
root / root
0644
vmsish.pm
4.212 KB
18 May 2023 9.34 PM
root / root
0644
warnings.pm
43.707 KB
18 May 2023 9.34 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF