lib/Skilletor/FSUtil.pm

filter: Statementstmt 95.9% 189 / 197 Branchbran 84.2% 96 / 114 Conditioncond 81.2% 26 / 32 MC/DCmcdc 76.1% 16 / 21 Subroutinesub 100% 32 / 32 Podpod 100% 17 / 17 totaltotal 91.0% 376 / 413 CC 73 SCAR 22.7
CC
73
Cov
91%
decode_utf8_lossy
19.0
same_file
17.7
path_normalize
16.0
CRAP 9.7
« lib/Skilletor/Config.pm ↑ Summary /usr/local/lib/perl5/5.44.0/x86_64-linux/POSIX.pm »
1 package Skilletor::FSUtil;
2 # ABSTRACT: File and path helpers that behave as the reference's Node calls do
3  
4 708 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 708 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 708 ▶use Carp qw( croak );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 708 ▶use Cwd ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 708 ▶use Digest::SHA qw( sha256_hex );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 708 ▶use Encode ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11 708 ▶use Errno ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12 708 ▶use Exporter qw( import );
Subroutine BEGIN: called CC=1 SCAR=0.0
13 708 ▶use Fcntl ();
Subroutine BEGIN: called CC=1 SCAR=0.0
14 708 ▶use Path::Tiny qw( path );
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 708 our $VERSION = '0.008000';
17  
18 708 our @EXPORT_OK = qw(
19 read_text decode_utf8_lossy encode_text
20 inner_segments hash_bytes is_executable
21 atomic_write write_text
22 path_join path_normalize path_resolve is_absolute
23 real_or_resolved same_path same_file to_posix
24 node_fs_error
25 );
26  
27 708 ▶use constant WIN32 => $^O eq 'MSWin32';
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 #### Text ##############################################################
30  
31 # readFileSync(path, "utf8"): bytes decoded as UTF-8, every ill-formed sequence one U+FFFD as
32 # the WHATWG decoder (and so V8) replaces it. No BOM is stripped.
33 142016 ▶sub decode_utf8_lossy {
Subroutine decode_utf8_lossy: called CC=19 SCAR=29.4
Pod documented
34 142016 my ( $bytes ) = @_;
35 142016 my $copy = $bytes;
36 142016 my $text = eval { Encode::decode( 'UTF-8', $copy, Encode::FB_CROAK() ) };
37 142016 ▶ return $text if defined $text;
Branch: 1 branch
BranchTrueFalseTotal
if defined $text 141986 30 142016
38 30 my $out = '';
39 30 my ( $needed, $seen, $cp, $lower, $upper ) = ( 0, 0, 0, 0x80, 0xBF );
40 30 my @bytes = unpack 'C*', $bytes;
41 30 my $i = 0;
42 30 ▶ while ( $i < @bytes ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < @bytes) 116366 30 116396
43 116366 my $b = $bytes[$i];
44 116366 ▶ if ( $needed == 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($needed == 0) 116282 84 116366
45 116282 $i++;
46 116282 ▶ if ( $b <= 0x7F ) { $out .= chr $b; next }
Branch: 1 branch
BranchTrueFalseTotal
if ($b <= 127) 116184 98 116282
47 98 ▶ if ( $b >= 0xC2 && $b <= 0xDF ) { $needed = 1; $cp = $b & 0x1F; next }
Branch: 1 branch
BranchTrueFalseTotal
if ($b >= 194 and $b <= 223) 22 76 98
Condition100%3/3
$b >= 194 and $b <= 223
!ll&&!rl&&r
294722
MC/DC100%2/2
$b >= 194 and $b <= 223
$b >= 194 $b <= 223
Truth table100%3/3
A and B
A= $b >= 194B= $b <= 223
ABresult
0X0
100
111
48 76 ▶ if ( $b >= 0xE0 && $b <= 0xEF ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($b >= 224 and $b <= 239) 28 48 76
Condition100%3/3
$b >= 224 and $b <= 239
!ll&&!rl&&r
291928
MC/DC100%2/2
$b >= 224 and $b <= 239
$b >= 224 $b <= 239
Truth table100%3/3
A and B
A= $b >= 224B= $b <= 239
ABresult
0X0
100
111
49 28 ▶ $lower = 0xA0 if $b == 0xE0;
Branch: 1 branch
BranchTrueFalseTotal
if $b == 224 2 26 28
50 28 ▶ $upper = 0x9F if $b == 0xED;
Branch: 1 branch
BranchTrueFalseTotal
if $b == 237 4 24 28
51 28 $needed = 2;
52 28 $cp = $b & 0xF;
53 28 next;
54 }
55 48 ▶ if ( $b >= 0xF0 && $b <= 0xF4 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($b >= 240 and $b <= 244) 9 39 48
Condition100%3/3
$b >= 240 and $b <= 244
!ll&&!rl&&r
29109
MC/DC100%2/2
$b >= 240 and $b <= 244
$b >= 240 $b <= 244
Truth table100%3/3
A and B
A= $b >= 240B= $b <= 244
ABresult
0X0
100
111
56 9 ▶ $lower = 0x90 if $b == 0xF0;
Branch: 1 branch
BranchTrueFalseTotal
if $b == 240 6 3 9
57 9 ▶ $upper = 0x8F if $b == 0xF4;
Branch: 1 branch
BranchTrueFalseTotal
if $b == 244 3 6 9
58 9 $needed = 3;
59 9 $cp = $b & 0x7;
60 9 next;
61 }
62 39 $out .= "\x{FFFD}";
63 39 next;
64 }
65 84 ▶ if ( $b < $lower || $b > $upper ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($b < $lower or $b > $upper) 15 69 84
Condition100%3/3
$b < $lower or $b > $upper
l!l&&r!l&&!r
7869
MC/DC100%2/2
$b < $lower or $b > $upper
$b < $lower $b > $upper
Truth table100%3/3
A or B
A= $b < $lowerB= $b > $upper
ABresult
1X1
011
000
66 15 ( $needed, $seen, $cp, $lower, $upper ) = ( 0, 0, 0, 0x80, 0xBF );
67 15 $out .= "\x{FFFD}";
68 15 next; # the byte is read again as the start of a sequence
69 }
70 69 $i++;
71 69 ( $lower, $upper ) = ( 0x80, 0xBF );
72 69 $cp = ( $cp << 6 ) | ( $b & 0x3F );
73 69 ▶ next unless ++$seen == $needed;
Branch: 1 branch
BranchTrueFalseTotal
unless ++$seen == $needed 33 36 69
74 36 $out .= chr $cp;
75 36 ( $needed, $seen, $cp ) = ( 0, 0, 0 );
76 }
77 30 ▶ $out .= "\x{FFFD}" if $needed;
Branch: 1 branch
BranchTrueFalseTotal
if $needed 8 22 30
78 30 return $out;
79 }
80  
81 67654 ▶sub read_text {
Subroutine read_text: called CC=1 SCAR=0.0
Pod documented
82 67654 my ( $file ) = @_;
83 67654 return decode_utf8_lossy( path($file)->slurp_raw );
84 }
85  
86 # A JavaScript string as UTF-8, as Buffer.from(s) and writeFileSync encode it: a lone
87 # surrogate becomes U+FFFD.
88 302027 ▶sub encode_text {
Subroutine encode_text: called CC=1 SCAR=0.0
Pod documented
89 302027 my ( $text ) = @_;
90 708 ▶ no warnings qw( surrogate utf8 );
Subroutine BEGIN: called CC=1 SCAR=0.0
91 302027 ( my $clean = "$text" ) =~ s/[\x{D800}-\x{DFFF}]/\x{FFFD}/g;
92 302027 return Encode::encode( 'UTF-8', $clean );
93 }
94  
95 #### Paths #############################################################
96  
97 416401 ▶sub is_absolute {
Subroutine is_absolute: called CC=2 SCAR=6.9
Pod documented
98 416401 my ( $p ) = @_;
99 416401 ▶ return 1 if $p =~ m{\A/};
Branch: 1 branch
BranchTrueFalseTotal
if $p =~ m[\A/] 384246 32155 416401
100 32155 return 1 if WIN32 && $p =~ m{\A(?:[\\]|[A-Za-z]:[\\/])};
101 32155 return 0;
102 }
103  
104 # path.normalize (posix): "." segments and doubled slashes go, ".." pops (never above the
105 # root; kept in front of a relative path), a trailing slash stays, "" is ".".
106 778160 ▶sub path_normalize {
Subroutine path_normalize: called CC=16 SCAR=27.7
Pod documented
107 778160 my ( $p ) = @_;
108 778160 ▶ return '.' if $p eq '';
Branch: 1 branch
BranchTrueFalseTotal
if $p eq "" 2 778158 778160
109 778158 ▶ my $abs = $p =~ m{\A/} ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$p =~ m[\A/] ? : 751384 26774 778158
110 778158 ▶ my $trailing = $p =~ m{/\z} ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$p =~ m[/\z] ? : 17 778141 778158
111 778158 my @out;
112 778158 for my $seg ( split m{/+}, $p ) {
113 4483899 ▶ next if $seg eq '' || $seg eq '.';
Branch: 1 branch
BranchTrueFalseTotal
if $seg eq "" or $seg eq "." 751389 3732510 4483899
Condition100%3/3
$seg eq "" or $seg eq "."
l!l&&r!l&&!r
75138273732510
MC/DC100%2/2
$seg eq "" or $seg eq "."
$seg eq "" $seg eq "."
Truth table100%3/3
A or B
A= $seg eq ""B= $seg eq "."
ABresult
1X1
011
000
114 3732510 ▶ if ( $seg eq '..' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($seg eq "..") 22202 3710308 3732510
115 22202 ▶ if ( @out && $out[-1] ne '..' ) { pop @out }
Branch: 2 branches
BranchTrueFalseTotal
if (@out and $out[-1] ne '..') { } 22191 11 22202
elsif (not $abs) { } 7 4 11
Condition100%3/3
@out and $out[-1] ne ".."
!ll&&!rl&&r
10122191
MC/DC100%2/2
@out and $out[-1] ne ".."
@out $out[-1] ne ".."
Truth table100%3/3
A and B
A= @outB= $out[-1] ne ".."
ABresult
0X0
100
111
116 7 elsif ( !$abs ) { push @out, '..' }
117 22202 next;
118 }
119 3710308 push @out, $seg;
120 }
121 778158 my $joined = join '/', @out;
122 778158 ▶ return $abs ? '/' : ( $trailing ? './' : '.' ) if $joined eq '';
Branch: 3 branches
BranchTrueFalseTotal
if $joined eq "" 9 778149 778158
$abs ? : 5 4 9
$trailing ? : 2 2 4
123 778149 ▶ return ( $abs ? '/' : '' ).$joined.( $trailing ? '/' : '' );
Branch: 2 branches
BranchTrueFalseTotal
$abs ? : 751379 26770 778149
$trailing ? : 13 778136 778149
124 }
125  
126 580930 ▶sub path_join {
Subroutine path_join: called CC=1 SCAR=0.0
Pod documented
127 580930 my ( @parts ) = @_;
128 580930 my $joined = join '/', grep { length } @parts;
129 580930 return path_normalize($joined);
130 }
131  
132 # path.resolve (posix): right to left until an absolute path, then the cwd; normalized,
133 # without a trailing slash.
134 189925 ▶sub path_resolve {
Subroutine path_resolve: called CC=8 SCAR=22.1
Pod documented
135 189925 my ( @parts ) = @_;
136 189925 my $resolved = '';
137 189925 for my $part ( reverse @parts ) {
138 212719 ▶ next unless defined $part && length $part;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $part and length $part 0 212719 212719
Condition33%1/3
defined $part and length $part
!ll&&!rl&&r
00212719
MC/DC0%0/2
defined $part and length $part
defined $part length $part
Truth table33%1/3
A and B
A= defined $partB= length $part
ABresult
0X0
100
111
139 212719 ▶ $resolved = $part.( length $resolved ? '/'.$resolved : '' );
Branch: 1 branch
BranchTrueFalseTotal
length $resolved ? : 22794 189925 212719
140 212719 ▶ last if is_absolute($part);
Branch: 1 branch
BranchTrueFalseTotal
if is_absolute($part) 189925 22794 212719
141 }
142 189925 ▶ $resolved = Cwd::getcwd().( length $resolved ? '/'.$resolved : '' ) unless is_absolute($resolved);
Branch: 2 branches
BranchTrueFalseTotal
unless is_absolute($resolved) 0 189925 189925
length $resolved ? : 0 0 0
143 189925 my $n = path_normalize($resolved);
144 189925 $n =~ s{(?<=.)/\z}{};
145 189925 return $n;
146 }
147  
148 51373 ▶sub to_posix {
Subroutine to_posix: called CC=1 SCAR=1.2
Pod documented
149 51373 my ( $p ) = @_;
150 51373 return $p unless WIN32;
151 0 ( my $q = $p ) =~ s{\\}{/}g;
152 0 return $q;
153 }
154  
155 # The segments of a path relative to some root ("\" separates like "/", empty and "."
156 # segments dropped), or why it names nothing beneath that root.
157 59 ▶sub inner_segments {
Subroutine inner_segments: called CC=6 SCAR=17.9
Pod documented
158 59 my ( $entry ) = @_;
159 59 ▶ return 'absolute' if is_absolute($entry) || $entry =~ m{\A[/\\]};
Branch: 1 branch
BranchTrueFalseTotal
if is_absolute($entry) or $entry =~ m(\A[/\\]) 6 53 59
Condition100%3/3
is_absolute($entry) or $entry =~ m(\A[/\\])
l!l&&r!l&&!r
4253
MC/DC100%2/2
is_absolute($entry) or $entry =~ m(\A[/\\])
is_absolute($entry) $entry =~ m(\A[/\\])
Truth table100%3/3
A or B
A= is_absolute($entry)B= $entry =~ m(\A[/\\])
ABresult
1X1
011
000
160 53 ▶ my @segments = grep { $_ ne '' && $_ ne '.' } split m{[\\/]}, $entry, -1;
Condition100%3/3
$_ ne '' && $_ ne '.'
!ll&&!rl&&r
4963
MC/DC100%2/2
$_ ne '' && $_ ne '.'
$_ ne '' $_ ne '.'
Truth table100%3/3
A && B
A= $_ ne ''B= $_ ne '.'
ABresult
0X0
100
111
161 53 ▶ return 'dotdot' if grep { $_ eq '..' } @segments;
Branch: 1 branch
BranchTrueFalseTotal
if grep {$_ eq "..";} @segments 7 46 53
162 46 ▶ return @segments ? \@segments : 'root';
Branch: 1 branch
BranchTrueFalseTotal
@segments ? : 38 8 46
163 }
164  
165 146756 ▶sub real_or_resolved {
Subroutine real_or_resolved: called CC=3 SCAR=11.0
Pod documented
166 146756 my ( $p ) = @_;
167 146756 ▶ my $real = -e $p ? eval { Cwd::abs_path($p) } : undef;
Branch: 1 branch
BranchTrueFalseTotal
-e $p ? : 145448 1308 146756
168 146756 ▶ return defined $real ? $real : path_resolve($p);
Branch: 1 branch
BranchTrueFalseTotal
defined $real ? : 145448 1308 146756
169 }
170  
171 73274 ▶sub same_path {
Subroutine same_path: called CC=2 SCAR=6.9
Pod documented
172 73274 my ( $a, $b ) = @_;
173 73274 ▶ return real_or_resolved($a) eq real_or_resolved($b) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
real_or_resolved($a) eq real_or_resolved($b) ? : 730 72544 73274
174 }
175  
176 208 ▶sub _dirname { my ( $p ) = @_; ( my $d = $p ) =~ s{/[^/]*\z}{}; return length $d ? $d : '/' }
Subroutine _dirname: called CC=2 SCAR=7.1
Branch: 1 branch
BranchTrueFalseTotal
length $d ? : 208 0 208
177 208 ▶sub _basename { my ( $p ) = @_; return ( $p =~ m{([^/]*)\z} )[0] }
Subroutine _basename: called CC=1 SCAR=0.0
178  
179 # Where a file path ends up once symlinks are followed, also for a missing file or a dangling
180 # link (then: the real parent dir joined with the final name).
181 276 ▶sub _file_target {
Subroutine _file_target: called CC=6 SCAR=19.9
182 276 my ( $path ) = @_;
183 276 my $p = path_resolve($path);
184 276 for ( 1 .. 40 ) {
185 276 my $bytes = encode_text($p);
186 276 ▶ if ( -e $bytes ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $bytes) 68 208 276
187 68 my $real = eval { Cwd::abs_path($bytes) };
188 68 ▶ return Encode::decode( 'UTF-8', $real ) if defined $real;
Branch: 1 branch
BranchTrueFalseTotal
if defined $real 68 0 68
189 }
190 208 ▶ last unless -l $bytes;
Branch: 1 branch
BranchTrueFalseTotal
unless -l $bytes 208 0 208
191 0 my $to = readlink $bytes;
192 0 ▶ last unless defined $to;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $to 0 0 0
193 0 $p = path_resolve( _dirname($p), Encode::decode( 'UTF-8', $to ) );
194 }
195 208 return path_join( real_or_resolved( _dirname($p) ), _basename($p) );
196 }
197  
198 # True when writing $a would write $b: the same target path, or the same inode. Never throws.
199 138 ▶sub same_file {
Subroutine same_file: called CC=6 SCAR=28.7
Pod documented
200 138 my ( $a, $b ) = @_;
201 138 ▶ return 1 if _file_target($a) eq _file_target($b);
Branch: 1 branch
BranchTrueFalseTotal
if _file_target($a) eq _file_target($b) 0 138 138
202 138 ▶ my @sa = stat encode_text($a) or return 0;
Branch: 1 branch
BranchTrueFalseTotal
my(@sa) = stat encode_text($a) or return 0 0 138 138
203 0 ▶ my @sb = stat encode_text($b) or return 0;
Branch: 1 branch
BranchTrueFalseTotal
my(@sb) = stat encode_text($b) or return 0 0 0 0
204 0 ▶ return ( $sa[0] == $sb[0] && $sa[1] == $sb[1] ) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$sa[0] == $sb[0] && $sa[1] == $sb[1] ? : 0 0 0
Condition0%0/3
$sa[0] == $sb[0] and $sa[1] == $sb[1]
!ll&&!rl&&r
000
MC/DC0%0/2
$sa[0] == $sb[0] and $sa[1] == $sb[1]
$sa[0] == $sb[0] $sa[1] == $sb[1]
Truth table0%0/3
A and B
A= $sa[0] == $sb[0]B= $sa[1] == $sb[1]
ABresult
0X0
100
111
205 }
206  
207 #### Errors ############################################################
208  
209 # libuv's words for the errors a file system call meets.
210 708 my %UV_MESSAGE = (
211 ENOENT => 'no such file or directory',
212 EACCES => 'permission denied',
213 EPERM => 'operation not permitted',
214 ENOTDIR => 'not a directory',
215 EISDIR => 'illegal operation on a directory',
216 ELOOP => 'too many symbolic links encountered',
217 ENAMETOOLONG => 'name too long',
218 EMFILE => 'too many open files',
219 ENFILE => 'file table overflow',
220 EIO => 'i/o error',
221 ENOMEM => 'not enough memory',
222 EBUSY => 'resource busy or locked',
223 );
224  
225 # The message Node gives a failed fs call: "ENOENT: no such file or directory, lstat '/x'". A
226 # read of a directory names no path ("EISDIR: illegal operation on a directory, read").
227 36 ▶sub node_fs_error {
Subroutine node_fs_error: called CC=4 SCAR=13.9
Pod documented
228 36 my ( $errno, $syscall, $path ) = @_;
229 36 local $! = $errno;
230 36 ▶ my $where = ', '.$syscall.( defined $path ? " '".$path."'" : '' );
Branch: 1 branch
BranchTrueFalseTotal
defined $path ? : 19 17 36
231 36 for my $code ( sort keys %UV_MESSAGE ) {
232 97 ▶ return $code.': '.$UV_MESSAGE{$code}.$where if $!{$code};
Branch: 1 branch
BranchTrueFalseTotal
if $!{$code} 36 61 97
233 }
234 0 return "$!".$where;
235 }
236  
237 #### Content ###########################################################
238  
239 17770 ▶sub hash_bytes {
Subroutine hash_bytes: called CC=1 SCAR=0.0
Pod documented
240 17770 my ( $bytes ) = @_;
241 17770 return 'sha256:'.sha256_hex($bytes);
242 }
243  
244 5480 ▶sub is_executable {
Subroutine is_executable: called CC=3 SCAR=11.1
Pod documented
245 5480 my ( $mode ) = @_;
246 5480 ▶ return ( ( $mode // 0 ) & 0100 ) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
($mode // 0) & 64 ? : 50 5430 5480
Condition50%1/2
$mode // 0
l!l
54800
MC/DC0%0/1
$mode // 0
$mode
Truth table50%1/2
A
A= $mode
Aresult
11
00
247 }
248  
249 708 my @BASE36 = ( 0 .. 9, 'a' .. 'z' );
250  
251 17948 ▶sub atomic_write {
Subroutine atomic_write: called CC=8 SCAR=20.9
Pod documented
252 17948 my ( $file, $bytes, $executable ) = @_;
253 17948 ▶ croak __PACKAGE__.'->atomic_write needs bytes, not characters' if $bytes =~ /[^\x{0}-\x{FF}]/;
Branch: 1 branch
BranchTrueFalseTotal
if $bytes =~ /[^\x{0}-\x{FF}]/ 1 17947 17948
254 17947 my $dir = path($file)->parent;
255 17947 $dir->mkpath;
256 17921 my $tmp = $dir->child( '.skilletor-tmp-'.$$.'-'.join '', map { $BASE36[ int rand 36 ] } 1 .. 11 );
257 17921 my $ok = eval {
258 17921 ▶ sysopen( my $fh, "$tmp", Fcntl::O_WRONLY() | Fcntl::O_CREAT() | Fcntl::O_TRUNC(), $executable ? 0777 : 0666 )
Branch: 2 branches
BranchTrueFalseTotal
sysopen my $fh, "$tmp", 577, $executable ? 511 : 438 or croak('open ' . $tmp . ': ' . $!) 17878 43 17921
$executable ? : 42 17879 17921
259 or croak 'open '.$tmp.': '.$!;
260 17878 binmode $fh;
261 17878 ▶ print {$fh} $bytes or croak 'write '.$tmp.': '.$!;
Branch: 1 branch
BranchTrueFalseTotal
print {$fh;} $bytes or croak('write ' . $tmp . ': ' . $!) 17878 0 17878
262 17878 ▶ close $fh or croak 'close '.$tmp.': '.$!;
Branch: 1 branch
BranchTrueFalseTotal
close $fh or croak('close ' . $tmp . ': ' . $!) 17878 0 17878
263 17878 ▶ rename "$tmp", "$file" or croak 'rename '.$tmp.': '.$!;
Branch: 1 branch
BranchTrueFalseTotal
rename "$tmp", "$file" or croak('rename ' . $tmp . ': ' . $!) 17878 0 17878
264 17878 1;
265 };
266 17921 ▶ unless ($ok) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($ok) 43 17878 17921
267 43 my $err = $@;
268 43 unlink "$tmp";
269 43 die $err;
270 }
271 17878 return;
272 }
273  
274 13493 ▶sub write_text {
Subroutine write_text: called CC=1 SCAR=0.0
Pod documented
275 13493 my ( $file, $text, $executable ) = @_;
276 13493 return atomic_write( $file, encode_text($text), $executable );
277 }
278  
279 708 1;
280  
281 __END__
« lib/Skilletor/Config.pm ↑ Summary /usr/local/lib/perl5/5.44.0/x86_64-linux/POSIX.pm »