Root.pm

filter: Statementstmt 10.6% 23 / 216 Branchbran 0.0% 0 / 98 Conditioncond 0.0% 0 / 46 MC/DCmcdc 0.0% 0 / 27 Subroutinesub 31.2% 5 / 16 Podpod 10.0% 1 / 10 totaltotal 7.0% 29 / 413 CC 70 SCAR 44.3
CC
70
Cov
6%
tran_unix
156.0
rooted
132.0
vmssplit
110.0
CRAP 83.8
↑ Summary SafeName.pm »
1 # Convert directory paths to/from rooted logical paths to evade
2 # VMS's directory depth limitations.
3 #
4 # Version: 0.012
5 # Author: Charles Lane lane@duphy4.physics.drexel.edu
6 # Revised: 4 Mar 2012
7 ##### remove non-vms usage
8 #
9  
10 =head1 NAME
11  
12 VMS::FileUtils::Root - convert directory paths to and from rooted logicals
13 (only works on VMS systems)
14  
15 =head1 SYNOPSIS
16  
17 use VMS::FileUtils::Root;
18  
19 $r = new VMS::FileUtils::Root 'disk:[dir1.dir2]';
20  
21 $path = $r->rooted('disk:[dir1.dir2.dir3]');
22  
23 $path = $r->unrooted('ROOTDIR_1:[dir3]');
24  
25 =head1 DESCRIPTION
26  
27 This module creates and uses rooted logical names in the /job logical
28 name table. This only works on VMS systems.
29  
30 =head2 new
31  
32 The directory path specified can be either in VMS or Unix format; and
33 can be either absolute (disk:[dir] or /disk/dir) or relative to the
34 current directory ([.dir] or dir/dir2). A blank or missing path is
35 taken to be the current directory, and a simple name (without any slashes
36 or brackets) is taken to be a subdirectory name.
37  
38 =head2 to_rooted
39  
40 This routine converts a directory path into a rooted directory path,
41 and returns the result in Unix format (without trailing '/', so
42 it can be used in chdir).
43  
44 The input directory path can be absolute, or relative based on the
45 current directory. Input can be either VMS or Unix format.
46  
47 =head2 from_rooted
48  
49 This routine converts a rooted directory path to an unrooted equivalent
50 path and returns the result in Unix format (without trailing '/').
51  
52 Note that if you input a relative path, it will be taken as relative
53 to the rooted directory. Input can be either VMS or Unix format.
54  
55 The output of this routine may contain more than 8 directory levels
56 and hence not be directly usable on VMS without conversion to a rooted
57 path.
58  
59 =cut
60  
61 package VMS::FileUtils::Root;
62 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
63 1 ▶use Cwd;
Subroutine BEGIN: called CC=1 SCAR=0.0
64 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
65 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
66 1 ▶use vars qw($VERSION $ROOTNUM $Pnode $Pdev $Pdir $Pname $Ptype $Pvers);
Subroutine BEGIN: called CC=1 SCAR=0.0
67  
68 1 $VERSION = '0.012';
69  
70 0 ▶sub new {
Subroutine new: not called CC=6 SCAR=37.4
Pod documented
71 0 my $pkg = shift;
72 0 ▶ $pkg = ref($pkg) || $pkg;
Condition0%0/3
ref $pkg || $pkg
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $pkg || $pkg
ref $pkg $pkg
Truth table0%0/3
A || B
A= ref $pkgB= $pkg
ABresult
1X1
011
000
73 0 my $b = shift;
74 0 my $self = {};
75 0 bless $self, $pkg;
76  
77  
78 0 $self->{O_LOWER} = 1; # all lowercase
79 0 $self->{O_LOCAL} = 1; # strip any node info
80 0 $self->{O_LOCALONLY} = 1; # warn if remote node
81 0 $self->{O_DIRONLY} = 1;
82 0 $b = $self->expander($b);
83 0 $self->{O_DIRONLY} = 0;
84  
85 0 my(@d) = split('/',$b);
86 0 ▶ pop @d if ($d[$#d] =~ /[\.\;]/);
Branch: 1 branch
BranchTrueFalseTotal
if $d[$#d] =~ /[\.\;]/ 0 0 0
87  
88 0 ▶ while ($#d > 8) { pop @d }
Branch: 1 branch
BranchTrueFalseTotal
if ($#d > 8) 0 0 0
89 0 $b = join('/',@d);
90  
91 0 $self->{base} = $b;
92 0 $b = $self->tran_unix($b, -d $b);
93 0 $b =~ s#\].*#.\]#;
94  
95 0 $ROOTNUM++;
96 0 ▶ if ($^O =~ /vms/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /vms/i) 0 0 0
97 0 $self->{rootlogical} = sprintf('ROOT_%X_%d',$$,$ROOTNUM);
98 0 my $rslt = `define/nolog/job/trans=conceal $self->{rootlogical} $b`;
99 0 ▶ carp("Error defining logical, '$rslt' status:$?\n") if $?;
Branch: 1 branch
BranchTrueFalseTotal
if $? 0 0 0
100 }
101 0 return $self;
102 }
103  
104 0 ▶sub DESTROY {
Subroutine DESTROY: not called CC=3 SCAR=24.8
105 0 my $self = shift;
106  
107 0 ▶ return if !defined($self->{rootlogical});
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"rootlogical"} 0 0 0
108 0 my $rslt = `deassign/job $self->{rootlogical}`;
109 0 ▶ carp("Error deassigning logical, '$rslt' status:$?\n") if $?;
Branch: 1 branch
BranchTrueFalseTotal
if $? 0 0 0
110 }
111  
112  
113 #
114 # have to do this stuff manually, std call chokes on too many subdirs
115 #
116  
117 0 ▶sub rooted ($;$$) {
Subroutine rooted: not called CC=11 SCAR=48.8
Pod undocumented
118 0 my $self = shift;
119 0 my $d = shift;
120 0 ▶ $d ||= '';
Condition0%0/2
$d ||= ""
l!l
00
MC/DC0%0/1
$d ||= ""
$d
Truth table0%0/2
A
A= $d
Aresult
11
00
121 0 my $opt = shift;
122 0 ▶ $opt ||= '';
Condition0%0/2
$opt ||= ""
l!l
00
MC/DC0%0/1
$opt ||= ""
$opt
Truth table0%0/2
A
A= $opt
Aresult
11
00
123 0 my $WantVMS = $opt =~ /O_VMS/;
124  
125 0 $d = $self->expander($d);
126  
127 0 ▶ if (lc(substr($d,0,length($self->{base}))) ne lc($self->{base})) {
Branch: 1 branch
BranchTrueFalseTotal
if (lc substr($d, 0, length $self->{"base"}) ne lc $self->{"base"}) 0 0 0
128 0 carp "$d isn't a subdirectory of $self->{base}\n";
129 0 return undef;
130 }
131 0 $d = substr($d,length($self->{base}));
132 0 my (@p) = split('/',$d);
133 0 shift @p;
134 0 my $f = pop(@p);
135 0 ▶ if (defined($f) && $f !~/\./) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $f and not $f =~ /\./) 0 0 0
Condition0%0/3
defined $f and not $f =~ /\./
!ll&&!rl&&r
000
MC/DC0%0/2
defined $f and not $f =~ /\./
defined $f not $f =~ /\./
Truth table0%0/3
A and not(B)
A= defined $fB= not $f =~ /\./
ABresult
0X0
100
111
136 0 push(@p,$f);
137 0 $f = '';
138 }
139 0 ▶ while($#p >= 0 && $p[0] eq '000000') {shift @p};
Branch: 1 branch
BranchTrueFalseTotal
if ($#p >= 0 and $p[0] eq "000000") 0 0 0
Condition0%0/3
$#p >= 0 and $p[0] eq "000000"
!ll&&!rl&&r
000
MC/DC0%0/2
$#p >= 0 and $p[0] eq "000000"
$#p >= 0 $p[0] eq "000000"
Truth table0%0/3
A and B
A= $#p >= 0B= $p[0] eq "000000"
ABresult
0X0
100
111
140 0 ▶ push(@p,'000000') if ($#p < 0);
Branch: 1 branch
BranchTrueFalseTotal
if $#p < 0 0 0 0
141 0 unshift(@p,'');
142 0 ▶ $f ||= '';
Condition0%0/2
$f ||= ""
l!l
00
MC/DC0%0/1
$f ||= ""
$f
Truth table0%0/2
A
A= $f
Aresult
11
00
143 0 $d = '/'.lc($self->{rootlogical}).join('/',@p,$f);
144 0 $d =~ s#/$##;
145 0 ▶ $d = $self->tran_unix($d) if $WantVMS;
Branch: 1 branch
BranchTrueFalseTotal
if $WantVMS 0 0 0
146 0 return $d;
147 }
148  
149 0 ▶sub unrooted ($;$$) {
Subroutine unrooted: not called CC=3 SCAR=24.8
Pod undocumented
150 0 my $self = shift;
151 0 my $d = shift;
152 0 my $opt = shift;
153 0 ▶ $opt ||= '';
Condition0%0/2
$opt ||= ""
l!l
00
MC/DC0%0/1
$opt ||= ""
$opt
Truth table0%0/2
A
A= $opt
Aresult
11
00
154 0 my $WantVMS = $opt =~ /O_VMS/;
155  
156 0 $d = $self->expander($d,'/'.$self->{rootlogical});
157 0 ▶ $d = $self->tran_unix($d) if $WantVMS;
Branch: 1 branch
BranchTrueFalseTotal
if $WantVMS 0 0 0
158 0 return $d;
159 }
160  
161  
162 0 ▶sub vms2unix {
Subroutine vms2unix: not called CC=5 SCAR=34.0
Pod undocumented
163 0 my $self = shift;
164 0 my (@in) = $self->vmssplit(shift);
165 0 my (@def) = $self->vmssplit(shift);
166 0 my (@cur) = $self->vmssplit(cwd);
167 0 ($cur[3],$cur[4]) = $self->tran_rooted($cur[3],$cur[4]);
168 0 my $j;
169  
170 0 ▶ for ($j = 0; $j < 8; $j++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($j < 8) 0 0 0
171 0 ▶ $def[$j] = $cur[$j] if !defined($def[$j]);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $def[$j] 0 0 0
172 0 ▶ $in[$j] = $def[$j] if !defined($in[$j]);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $in[$j] 0 0 0
173 }
174  
175 0 $in[4] = $self->make_abs($cur[4],$in[4]);
176 0 ($in[3],$in[4]) = $self->tran_rooted($in[3],$in[4]);
177  
178 0 ▶ $in[5] = $in[6] = $in[7] = undef if ($self->{O_DIRONLY});
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"O_DIRONLY"} 0 0 0
179  
180 0 return $self->combine_for_unix(@in);
181  
182 }
183  
184 #
185 # translate "device" + "directory"
186 # from a conceal logical with rooted directory to
187 # an "absolute" form.
188 # and ignore that 8 directory depth stuff, too.
189 #
190  
191 0 ▶sub tran_rooted {
Subroutine tran_rooted: not called CC=8 SCAR=42.8
Pod undocumented
192 0 my $self = shift;
193 0 my $dev = shift;
194 0 my $dir = shift;
195  
196 0 my $d = $dev;
197 0 $d =~ s#\:\Z##;
198 0 $d = $ENV{$d};
199 0 ▶ if ($d) {
Branch: 1 branch
BranchTrueFalseTotal
if ($d) 0 0 0
200 0 my (@r) = $self->vmssplit($d);
201 0 ▶ if ($r[3] && $r[4] && $r[4] =~ /\.\]\Z/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($r[3] and $r[4] and $r[4] =~ /\.\]\Z/) 0 0 0
Condition0%0/6
$r[3] and $r[4] and $r[4] =~ /\.\]\Z/
!ll&&!rl&&r
000
$r[3] and $r[4]
!ll&&!rl&&r
000
MC/DC0%0/3
$r[3] and $r[4] and $r[4] =~ /\.\]\Z/
$r[3] $r[4] $r[4] =~ /\.\]\Z/
Truth table0%0/4
A and B and C
A= $r[3]B= $r[4]C= $r[4] =~ /\.\]\Z/
ABCresult
0XX0
10X0
1100
1111
202 0 $dev = $r[3];
203 0 $dir = $r[4].$dir;
204 0 $dir =~ s#\.\]\[#.#;
205 }
206 }
207  
208 0 $d = $dir;
209 0 $d =~ s#[\[\]]##g;
210 0 my (@d) = split('\.',$d);
211 0 my (@p) = ();
212 0 foreach (@d) {
213 0 ▶ push @p,$_ unless $_ eq '000000';
Branch: 1 branch
BranchTrueFalseTotal
unless $_ eq "000000" 0 0 0
214 }
215 0 ▶ push @p,'000000' if $#p < 0;
Branch: 1 branch
BranchTrueFalseTotal
if $#p < 0 0 0 0
216 0 $dir = '['.join('.',@p).']';
217 0 return ($dev,$dir);
218 }
219  
220  
221 #
222 # make a relative directory path absolute
223 # VMS syntax
224 #
225  
226 0 ▶sub make_abs {
Subroutine make_abs: not called CC=7 SCAR=40.3
Pod undocumented
227 0 my $self = shift;
228 0 my $base = shift;
229 0 my $rel = shift;
230  
231 0 ▶ return $rel unless $rel =~ /\A\[(\.|\-|\])/;
Branch: 1 branch
BranchTrueFalseTotal
unless $rel =~ /\A\[(\.|\-|\])/ 0 0 0
232  
233 0 $base =~ s#[\[\]]##g;
234 0 $rel =~ s#[\[\]]##g; # strip brackets
235 0 my (@b) = split('\.',$base);
236 0 my (@r) = split('\.',$rel);
237  
238 0 foreach (@r) {
239 0 ▶ if (/\A\-+\Z/) {
Branch: 2 branches
BranchTrueFalseTotal
if (/\A\-+\Z/) { } 0 0 0
elsif ($_ ne '') { } 0 0 0
240 0 my $j;
241 0 ▶ if (length($_) > $#b+1) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $_ > $#b + 1) 0 0 0
242 0 warn 'relative directory going above root directory';
243 }
244 0 ▶ for ($j = 0; $j < length($_); $j++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($j < length $_) 0 0 0
245 0 pop @b;
246 }
247 } elsif ($_ ne '') {
248 0 push @b,$_;
249 }
250 }
251 0 return '['.join('.',@b).']';
252 }
253  
254 #
255 # split a VMS filename into components, we don't check for validity
256 # of the components, as long as it parses okay.
257 #
258 # directory names in < ... > get translated to [ ... ]
259 # versions with '.' separator ( file.txt.1) get translated to ';'
260 #
261 1 $Pnode = '([a-z0-9][a-z0-9\-\.]*)(\"([a-z0-9]+)(\s+(\w*))?\")?\:\:';
262 1 $Pdev = '[\w\$]+\:';
263 1 $Pdir = '\[([\w\.\-]*)\]|\<([\w\.\-]*)\>';
264 1 $Pname = '[\w\$\-]+';
265 1 $Ptype = '\.[\w\$\-]*';
266 1 $Pvers = '(\;|\.)((\+\d|\-\d)?\d*)';
267  
268  
269  
270  
271  
272 0 ▶sub vmssplit {
Subroutine vmssplit: not called CC=10 SCAR=47.0
Pod undocumented
273 0 my $self = shift;
274 0 my $f = shift;
275 0 ▶ $f = '' unless defined($f);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $f 0 0 0
276  
277 0 my ($node,$user,$pwd,$dev,$dir,$name,$type,$vers,$adir,$bdir,$idir,$rdir);
278  
279 0 ▶ if ($f =~ /\A($Pnode)?($Pdev)?($Pdir)?($Pname)?($Ptype)?($Pvers)?\Z/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($f =~ /\A($VMS::FileUtils::Root::Pnode)?($VMS::FileUtils::Root::Pdev)?($VMS::FileUtils::Root::Pdir)?($VMS::FileUtils::Root::Pname)?($VMS::FileUtils::Root::Ptype)?($VMS::FileUtils::Root::Pvers)?\Z/i) { } 0 0 0
280 0 $node = $2;
281 0 $user = $4;
282 0 $pwd = $6;
283 0 $dev = $7;
284 0 $dir = $8;
285 0 $bdir = $9;
286 0 $adir = $10;
287 0 ▶ $rdir = $bdir ? $bdir : $adir ;
Branch: 1 branch
BranchTrueFalseTotal
$bdir ? : 0 0 0
288 0 ▶ $rdir = '['.$rdir.']' if defined($rdir) && $rdir ne '';
Branch: 1 branch
BranchTrueFalseTotal
if defined $rdir and $rdir ne "" 0 0 0
Condition0%0/3
defined $rdir and $rdir ne ""
!ll&&!rl&&r
000
MC/DC0%0/2
defined $rdir and $rdir ne ""
defined $rdir $rdir ne ""
Truth table0%0/3
A and B
A= defined $rdirB= $rdir ne ""
ABresult
0X0
100
111
289 0 $name = $11;
290 0 $type = $12;
291 0 ▶ $vers = $15 ? ';'.$15 : undef;
Branch: 1 branch
BranchTrueFalseTotal
$15 ? : 0 0 0
292 } else {
293 0 warn "$f is not a valid VMS filename";
294 }
295  
296 0 ▶ if ($node && $self->{O_LOCALONLY}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node and $self->{"O_LOCALONLY"}) 0 0 0
Condition0%0/3
$node and $self->{"O_LOCALONLY"}
!ll&&!rl&&r
000
MC/DC0%0/2
$node and $self->{"O_LOCALONLY"}
$node $self->{"O_LOCALONLY"}
Truth table0%0/3
A and B
A= $nodeB= $self->{"O_LOCALONLY"}
ABresult
0X0
100
111
297 0 warn 'node specified for what should be a local path';
298 }
299 0 ▶ if ($self->{O_LOCAL}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"O_LOCAL"}) 0 0 0
300 0 $node = $user = $pwd = undef;
301 }
302  
303 0 return ($node,$user,$pwd,$dev,$rdir,$name,$type,$vers);
304 }
305  
306 #
307 # convert deconstructed VMS filespec to Unix
308 # note that if we have node/user/password info (a la decnet)
309 # it gets converted to a "URL" style prefix: //user:password@node
310 #
311  
312 0 ▶sub combine_for_unix {
Subroutine combine_for_unix: not called CC=10 SCAR=47.0
Pod undocumented
313 0 my $self = shift;
314 0 ▶ my ($node,$user,$pwd,$dev,$dir,$name,$type,$vers) = map($self->{O_LOWER}?lc($_):$_,@_);
Branch: 1 branch
BranchTrueFalseTotal
$self->{'O_LOWER'} ? : 0 0 0
315  
316 0 my $s = '';
317  
318 0 ▶ if ($node) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node) 0 0 0
319 0 $s .= '//';
320 0 ▶ if ($user) {
Branch: 1 branch
BranchTrueFalseTotal
if ($user) 0 0 0
321 0 $s .= $user;
322 0 ▶ if ($pwd) {
Branch: 1 branch
BranchTrueFalseTotal
if ($pwd) 0 0 0
323 0 $s .= ':'.$pwd;
324 }
325 0 $s .= '@';
326 }
327 0 $s .= $node;
328 }
329 0 ▶ if ($dev) {
Branch: 1 branch
BranchTrueFalseTotal
if ($dev) 0 0 0
330 0 $dev =~ s#\:\Z##;
331 0 $s .= '/'.$dev;
332 }
333 0 ▶ if ($dir) {
Branch: 1 branch
BranchTrueFalseTotal
if ($dir) 0 0 0
334 0 $dir =~ s#[\[\]]##g;
335 0 $dir =~ s#\.#/#g;
336 0 $s .= '/'.$dir;
337 }
338 0 ▶ if ($name||$type||$vers) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name or $type or $vers) 0 0 0
Condition0%0/6
$name or $type or $vers
l!l&&r!l&&!r
000
$name or $type
l!l&&r!l&&!r
000
MC/DC0%0/3
$name or $type or $vers
$name $type $vers
Truth table0%0/4
A or B or C
A= $nameB= $typeC= $vers
ABCresult
1XX1
01X1
0011
0000
339 0 $s .= '/'.$name.$type.$vers;
340 }
341 0 return $s;
342 }
343  
344  
345  
346 0 ▶sub tran_unix {
Subroutine tran_unix: not called CC=12 SCAR=50.5
Pod undocumented
347 0 my $self = shift;
348 0 my (@p) = split('/',shift);
349 0 my (@p2);
350 my ($d);
351  
352 0 $d = shift(@p);
353 0 ▶ if (defined($d) && $d eq '') {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $d and $d eq '') { } 0 0 0
Condition0%0/3
defined $d and $d eq ""
!ll&&!rl&&r
000
MC/DC0%0/2
defined $d and $d eq ""
defined $d $d eq ""
Truth table0%0/3
A and B
A= defined $dB= $d eq ""
ABresult
0X0
100
111
354 0 $d = shift(@p).':';
355 } else {
356 0 unshift(@p,$d);
357 0 $d = '';
358 0 $p2[0] = '';
359 }
360  
361 0 foreach (@p) {
362 0 ▶ next unless defined($_);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $_ 0 0 0
363 0 ▶ next if $_ eq '.';
Branch: 1 branch
BranchTrueFalseTotal
if $_ eq "." 0 0 0
364  
365 0 ▶ if ($_ eq '..') {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ eq '..') { } 0 0 0
366 0 ▶ if ($#p2 == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($#p2 == 0) 0 0 0
367 0 ▶ if ($p2[0] =~ /\A\-*\Z/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($p2[0] =~ /\A\-*\Z/) 0 0 0
368 0 $p2[0] .= '-';
369 0 next;
370 }
371 }
372 0 pop @p2;
373 } else {
374 0 push @p2, $_;
375 }
376 }
377 0 my $f = pop @p2;
378 #
379 # our only hint that the trailing bit is a filename: it has a . or ; in it
380 #
381 0 ▶ if (defined($f) && $f !~ /[\.\;]/) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $f and not $f =~ /[\.\;]/) 0 0 0
Condition0%0/3
defined $f and not $f =~ /[\.\;]/
!ll&&!rl&&r
000
MC/DC0%0/2
defined $f and not $f =~ /[\.\;]/
defined $f not $f =~ /[\.\;]/
Truth table0%0/3
A and not(B)
A= defined $fB= not $f =~ /[\.\;]/
ABresult
0X0
100
111
382 0 push @p2, $f;
383 0 $f = '';
384 }
385 0 ▶ $f ||= '';
Condition0%0/2
$f ||= ""
l!l
00
MC/DC0%0/1
$f ||= ""
$f
Truth table0%0/2
A
A= $f
Aresult
11
00
386 0 return $d.'['.join('.',@p2).']'.$f;
387 }
388  
389 0 ▶sub expander {
Subroutine expander: not called CC=5 SCAR=34.0
Pod undocumented
390 0 my $self = shift;
391 0 my $dir = shift;
392 0 my $def = shift;
393 0 my $dironly = $self->{O_DIRONLY};
394  
395 0 ▶ $dir = '' if !defined($dir);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $dir 0 0 0
396 0 ▶ if ($dir !~ /[\[\<\;\:]/) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($dir =~ /[\[\<\;\:]/) 0 0 0
397 #
398 # how can we tell if this is /dev/dir/file or /dev/dir/sdir ?
399 #
400 0 $dir = $self->tran_unix($dir);
401 }
402  
403 0 ▶ if (defined($def) && $def !~ /[\[\<\;\:]/) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $def and not $def =~ /[\[\<\;\:]/) 0 0 0
Condition0%0/3
defined $def and not $def =~ /[\[\<\;\:]/
!ll&&!rl&&r
000
MC/DC0%0/2
defined $def and not $def =~ /[\[\<\;\:]/
defined $def not $def =~ /[\[\<\;\:]/
Truth table0%0/3
A and not(B)
A= defined $defB= not $def =~ /[\[\<\;\:]/
ABresult
0X0
100
111
404 0 $def = $self->tran_unix($def);
405 }
406  
407 0 return $self->vms2unix($dir,$def);
408 }
409  
410 1 1;
↑ Summary SafeName.pm »