File Coverage

lib/Rex/Helper/File/Stat/Win32.pm
Criterion Covered Total %
statement 11 37 29.7
branch 0 4 0.0
condition n/a
subroutine 4 12 33.3
pod 0 8 0.0
total 15 61 24.5


line stmt bran cond sub pod time code
1             #
2             # (c) Jan Gehring
3             #
4              
5             package Rex::Helper::File::Stat::Win32;
6              
7 53     53   802 use v5.12.5;
  53         294  
8 53     53   392 use warnings;
  53         182  
  53         2610  
9              
10             our $VERSION = '1.14.2.3'; # TRIAL VERSION
11              
12 53     53   459 use Fcntl;
  53         196  
  53         13977  
13              
14 53     53   512 use Rex::Interface::Exec;
  53         164  
  53         515  
15              
16             sub S_ISDIR {
17 0     0 0   shift;
18 0           Fcntl::S_ISDIR(@_);
19             }
20              
21             sub S_ISREG {
22 0     0 0   shift;
23 0           Fcntl::S_ISREG(@_);
24             }
25              
26             sub S_ISLNK {
27 0     0 0   shift;
28 0 0         if ( Rex::is_ssh() ) {
29 0           my $exec = Rex::Interface::Exec->create;
30 0           $exec->exec("perl -le 'use Fcntl; exit Fcntl::S_ISLNK($_[0])'");
31 0           return $?;
32             }
33             else {
34 0           Rex::Logger::info( "S_ISLNK not supported on your platform.", "warn" );
35 0           return 0;
36             }
37             }
38              
39             sub S_ISBLK {
40 0     0 0   shift;
41 0           Fcntl::S_ISBLK(@_);
42             }
43              
44             sub S_ISCHR {
45 0     0 0   shift;
46 0           Fcntl::S_ISCHR(@_);
47             }
48              
49             sub S_ISFIFO {
50 0     0 0   shift;
51 0           Fcntl::S_ISFIFO(@_);
52             }
53              
54             sub S_ISSOCK {
55 0     0 0   shift;
56              
57 0 0         if ( Rex::is_ssh() ) {
58 0           my $exec = Rex::Interface::Exec->create;
59 0           $exec->exec("perl -le 'use Fcntl; exit Fcntl::S_ISSOCK($_[0])'");
60 0           return $?;
61             }
62             else {
63 0           Rex::Logger::info( "S_ISSOCK not supported on your platform.", "warn" );
64 0           return 0;
65             }
66             }
67              
68             sub S_IMODE {
69 0     0 0   shift;
70 0           Fcntl::S_IMODE(@_);
71             }
72              
73             1;