Home
last modified time | relevance | path

Searched full:fh (Results 1 – 25 of 841) sorted by relevance

12345678910>>...34

/openbsd-src/gnu/usr.bin/perl/ext/PerlIO-scalar/t/
H A Dscalar.t
/openbsd-src/gnu/usr.bin/perl/cpan/File-Temp/t/
H A Dobject.t44 my $fh = File::Temp->new( SUFFIX => '.txt' );
46 ok( (-f "$fh"), "File $fh exists" );
48 ok( close( $fh ), "Close file $fh" );
49 ok( (-f "$fh"), "File $fh still exists after close" );
51 push(@files, "$fh");
92 $fh = File::Temp->new(
97 ok( $fh->unlink_on_destroy, "should unlink");
98 print "# TEMPFILE: Created $fh\n";
100 ok( (-f "$fh"), "File $fh exists in tempdir?");
101 push(@files, "$fh");
[all …]
H A Dcmp.t10 my $fh = File::Temp->new();
11 isa_ok ($fh, 'File::Temp');
13 ok( "$fh" ne "foo", "compare stringified object with string");
14 ok( $fh ne "foo", "compare object with string");
15 ok( $fh eq $fh, "compare eq with self");
17 ok( $fh != 0, "compare != 0");
18 ok( $fh == $fh, "compare == with self");
19 ok( $fh != \*STDOUT, "compare != \*STDOUT");
22 my $num = $fh+0;
26 my $str = "$fh";
[all …]
/openbsd-src/gnu/usr.bin/perl/t/lib/warnings/
H A Dutf8363 open(my $fh, "+>:utf8", $file);
364 print $fh "\x{D7FF}", "\n";
365 print $fh "\x{D800}", "\n";
366 print $fh "\x{D900}", "\n";
367 print $fh "\x{DA00}", "\n";
368 print $fh "\x{DB00}", "\n";
369 print $fh "\x{DC00}", "\n";
370 print $fh "\x{DD00}", "\n";
371 print $fh "\x{DE00}", "\n";
372 print $fh "\x{DF00}", "\n";
[all …]
/openbsd-src/gnu/usr.bin/perl/cpan/autodie/t/
H A Dutf8_open.t31 open my $fh, ">", $file;
33 my @layers = PerlIO::get_layers($fh);
36 print $fh $txt;
37 close $fh;
42 open my $fh, "<", $file;
44 my @layers = PerlIO::get_layers($fh);
47 is join("\n", <$fh>), $txt;
52 open my($fh), $file;
54 my @layers = PerlIO::get_layers($fh);
57 is join("\n", <$fh>), $txt;
[all …]
/openbsd-src/gnu/usr.bin/perl/cpan/Scalar-List-Utils/t/
H A Dopenhan.t12 my $fh = \*STDERR;
13 is(openhandle($fh), $fh, 'STDERR');
26 open my $fh, "<", $0;
27 skip "could not open $0 for reading: $!", 2 unless $fh;
28 is(openhandle($fh), $fh, "works with indirect filehandles");
29 close($fh);
30 is(openhandle($fh), undef, "works with indirect filehandles");
36 open my $fh, "<", \"in-memory file";
37 skip "could not open in-memory file: $!", 2 unless $fh;
38 is(openhandle($fh), $fh, "works with in-memory files");
[all …]
/openbsd-src/gnu/usr.bin/perl/cpan/Encode/t/
H A Dperlio.t53 open my $fh, "<:utf8", $ufile or die "$ufile : $!";
54 my @uline = <$fh>;
56 close $fh;
70 open $fh, ">:encoding($e)", $pfile or die "$sfile : $!";
71 $fh->autoflush(0);
72 print $fh $utext;
73 close $fh;
83 open $fh, ">:encoding($e)", $pfile or die "$sfile : $!";
84 $fh->autoflush(1);
86 print $fh
[all...]
/openbsd-src/gnu/usr.bin/perl/ext/PerlIO-encoding/t/
H A Dfallback.t30 ok(open(my $fh,">encoding(iso-8859-1)",$file),"opened iso-8859-1 file");
32 print $fh $str,"0.02\n";
33 close($fh);
37 open($fh,'<',$file) || die "File cannot be re-opened";
38 my $line = <$fh>;
40 close($fh);
44 ok(open(my $fh,">encoding(iso-8859-1)",$file),"opened iso-8859-1 file");
46 print $fh $str,"0.02\n";
47 close($fh);
49 open($fh,'<',$file) || die "File cannot be re-opened";
[all …]
/openbsd-src/gnu/usr.bin/perl/t/io/
H A Dperlio_open.t19 ok((open my $fh, "+>", undef), "open my \$fh, '+>', undef");
20 print $fh "the right write stuff";
21 ok(seek($fh, 0, SEEK_SET), "seek to zero");
22 my $data = <$fh>;
27 ok((open my $fh, "+<", undef), "open my \$fh, '+<', undef");
28 print $fh "the right read stuff";
29 ok(seek($fh, 0, SEEK_SET), "seek to zero");
30 my $data = <$fh>;
36 ok((open my $fh, "+>>", undef), "open my \$fh, '+>>', undef")
38 print $fh "abc";
[all …]
H A Dthrough.t45 my ($fh, $str, $read_c, $how_r, $write_c, $how_w, $why) = @_;
48 $buf .= $_ while <$fh>;
51 $buf .= $_ while <$fh>;
54 $buf .= $in while $c = read($fh, $in, $read_c);
57 $buf .= $in while $c = sysread($fh, $in, $read_c);
61 close $fh or die "close: $!";
71 my $fh;
74 …open $fh, '-|', qq[$Perl -we "$set_out;print for grep length, split /(.{1,$write_c})/s, qq($quoted…
78 …open $fh, '-|', qq[$Perl -we "$set_out;eval qq(\\x24\\x7c = 1) or die;print for grep length, split…
81 …open $fh, '-|', qq[$Perl -we "$set_out;eval qq(\\x5b\\x4f = 1) or die;print for grep length, split…
[all …]
H A Dfs.t95 open(FH,'>x') || die "Can't create x";
96 close(FH);
97 open(FH,'>a') || die "Can't create a";
98 close(FH);
185 ok(open(my $fh, "<", "a"), "open a");
186 is(chmod(0, $fh), 1, "fchmod");
190 skip "chmod(0, FH) means assume user defaults on VMS", 1 if $^O eq 'VMS';
194 $mode = (stat $fh)[2];
201 close $fh;
203 ok(!chmod(0666, $fh), "chmod through closed handle fails");
[all …]
/openbsd-src/gnu/usr.bin/perl/dist/IO/lib/IO/
H A DFile.pm13 my $fh = IO::File->new();
14 if ($fh->open("< file")) {
15 print <$fh>;
16 $fh->close;
19 my $fh = IO::File->new("> file");
20 if (defined $fh) {
21 print $fh "bar\n";
22 $fh->close;
25 my $fh = IO::File->new("file", "r");
26 if (defined $fh) {
[all...]
/openbsd-src/gnu/usr.bin/perl/ext/PerlIO-via/
H A Dvia.pm15 open($fh,"<:via(Layer)",...);
18 open($fh,">:via(Some::Other::Package)",...);
32 open( my $fh, "<:via(StripHTML)", "index.html" );
33 my @line = <$fh>;
55 In the method descriptions below I<$fh> will be
57 It refers to the layer below. I<$fh> is not passed if the layer
63 =item $class->PUSHED([$mode,[$fh]])
73 =item $obj->POPPED([$fh])
77 =item $obj->UTF8($belowFlag,[$fh])
90 =item $obj->OPEN($path,$mode,[$fh])
[all...]
/openbsd-src/gnu/usr.bin/perl/cpan/Digest-SHA/t/
H A Dmethods.t25 my $fh = FileHandle->new($tempfile, "w");
26 binmode($fh);
27 print $fh "bcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
28 $fh->close;
50 $fh = FileHandle->new($tempfile, "r");
51 binmode($fh);
52 print "not " unless $sha->clone->addfile($fh)->hexdigest eq $rsp;
54 $fh->close;
63 $fh = FileHandle->new($tempfile, "w");
64 binmode($fh);
[all …]
/openbsd-src/gnu/usr.bin/perl/dist/Devel-SelfStubber/t/
H A DDevel-SelfStubber.t33 open FH, '>', $file or die $!;
35 print FH;
38 close FH;
43 open FH, '>', $file or die $!;
44 select FH;
48 close FH or die $!;
50 open FH, '<', $file or die $!;
51 my @A = <FH>;
64 open FH, '>', $file or die $!;
65 select FH;
[all …]
/openbsd-src/gnu/usr.bin/perl/cpan/HTTP-Tiny/t/
H A D020_headers.t19 my $fh = tmpfile($header);
21 my $handle = HTTP::Tiny::Handle->new(fh => $fh);
28 my $fh = tmpfile($header);
30 my $handle = HTTP::Tiny::Handle->new(fh => $fh);
37 my $fh = tmpfile($header);
39 my $handle = HTTP::Tiny::Handle->new(fh => $fh);
45 my $fh = tmpfile();
46 my $handle = HTTP::Tiny::Handle->new(fh => $fh);
49 rewind($fh);
54 my $fh = tmpfile();
[all …]
H A D030_response.t23 my $fh = tmpfile($response);
24 my $handle = HTTP::Tiny::Handle->new(fh => $fh);
31 my $fh = tmpfile($response);
32 my $handle = HTTP::Tiny::Handle->new(fh => $fh);
40 my $fh = tmpfile($response);
41 my $handle = HTTP::Tiny::Handle->new(fh => $fh);
49 my $fh = tmpfile($response);
50 my $handle = HTTP::Tiny::Handle->new(fh => $fh);
59 my $fh = tmpfile($response);
60 my $handle = HTTP::Tiny::Handle->new(fh => $fh);
[all …]
/openbsd-src/gnu/usr.bin/perl/cpan/Win32API-File/t/
H A Dtie.t29 my $fh = Win32API::File->new("+> $filename")
32 my $tell = tell $fh;
33 is(0+$tell, 0, "tell \$fh == '$tell'");
37 ok(print($fh $text), "printed 'some text\\n'");
39 $tell = tell $fh;
43 my $seek = seek($fh, 0, 0);
46 my $eof = eof $fh;
49 my $readline = <$fh>;
55 $eof = eof $fh;
58 ok(close($fh), 'closed filehandle');
[all …]
/openbsd-src/gnu/usr.bin/perl/ext/VMS-Stdio/t/
H A Dvms_stdio.t14 $fh = VMS::Stdio::vmsopen("+>$name",'ctx=rec','shr=put','fop=dlt','dna=.tmp');
15 print +($fh ? '' : 'not '), "ok 2\n";
17 print +(flush($fh) ? '' : 'not '),"ok 3\n";
18 print +(sync($fh) ? '' : 'not '),"ok 4\n";
23 $fh->autoflush; # Can we autoload autoflush from IO::File? Do or die.
26 print 'not ' unless print $fh scalar(localtime($time)),"\n";
29 print +(rewind($fh) ? '' : 'not '),"ok 8\n";
31 chop($line = <$fh>);
34 ($gotname) = (getname($fh) =~/\](.*);/);
38 ($gotname) = (VMS::Filespec::vmsify(getname($fh)) =~/\](.*)/);
[all …]
/openbsd-src/gnu/usr.bin/perl/lib/
H A DFileHandle.t27 my $fh = (new FileHandle "./TEST", O_RDONLY
29 ok(defined($fh), "create new handle O_RDONLY");
31 my $buffer = <$fh>;
34 ungetc $fh ord 'A';
36 CORE::read($fh, $buf,1);
38 close $fh;
40 $fh = new FileHandle;
41 ok(($fh->open("< TEST") && <$fh> eq $buffer),
44 $fh->seek(0,0);
45 ok((<$fh> eq $buffer), "Averted possible mixed CRLF/LF in t/TEST");
[all …]
H A DFileHandle.pm114 my $fh = FileHandle->new;
115 if ($fh->open("< file")) {
116 print <$fh>;
117 $fh->close;
120 my $fh = FileHandle->new("> FOO");
121 if (defined $fh) {
122 print $fh "bar\n";
123 $fh->close;
126 my $fh = FileHandle->new("file", "r");
127 if (defined $fh) {
[all …]
/openbsd-src/gnu/usr.bin/perl/ext/PerlIO-via/t/
H A Dvia.t18 my $fh;
24 ok( !open($fh,"<via(PerlIO::via::QuotedPrint)", $tmp), 'open QuotedPrint for input fails');
25 ok( open($fh,">via(PerlIO::via::QuotedPrint)", $tmp), 'open QuotedPrint for output');
26 ok( (print $fh $a), "print to output file");
27 ok( close($fh), 'close output file');
29 ok( open($fh,"<via(PerlIO::via::QuotedPrint)", $tmp), 'open QuotedPrint for input');
30 { local $/; $b = <$fh> }
31 ok( close($fh), "close input file");
43 my $fd = open($fh,'>',$tmp) && fileno($fh);
[all...]
/openbsd-src/gnu/usr.bin/perl/t/op/
H A Dincfilter.t27 my $fh;
29 open $fh, "<", \'pass("Can return file handles from \@INC");';
30 do $fh or die;
63 open $fh, "<", \'fail("File handles and filters work from \@INC");';
65 do [$fh, sub {s/fail/pass/; return;}] or die;
67 open $fh, "<", \'fail("File handles and filters with state work from \@INC");';
69 do [$fh, sub {s/$_[1]/pass/; return;}, 'fail'] or die;
91 open $fh, "$echo_command $pass_arg|" or die $!;
93 do $fh or die;
95 open $fh, "$echo_command $fail_arg|" or die $!;
[all …]
/openbsd-src/usr.bin/sort/
H A Dfile.c772 file_header_init(struct file_header **fh, const char *fn, size_t file_pos) in file_header_init() argument
776 *fh = sort_malloc(sizeof(struct file_header)); in file_header_init()
777 (*fh)->file_pos = file_pos; in file_header_init()
778 (*fh)->fr = file_reader_init(fn); in file_header_init()
779 if ((*fh)->fr == NULL) { in file_header_init()
783 line = file_reader_readline((*fh)->fr); in file_header_init()
785 file_reader_free((*fh)->fr); in file_header_init()
786 (*fh)->fr = NULL; in file_header_init()
787 (*fh)->si = NULL; in file_header_init()
789 (*fh) in file_header_init()
798 file_header_close(struct file_header ** fh) file_header_close() argument
817 file_header_swap(struct file_header ** fh,size_t i1,size_t i2) file_header_swap() argument
833 file_header_heap_swim(struct file_header ** fh,size_t indx) file_header_heap_swim() argument
852 file_header_heap_sink(struct file_header ** fh,size_t indx,size_t size) file_header_heap_sink() argument
882 file_header_list_rearrange_from_header(struct file_header ** fh,size_t size) file_header_list_rearrange_from_header() argument
891 file_header_list_push(struct file_header * f,struct file_header ** fh,size_t size) file_header_list_push() argument
906 file_header_print(struct file_header * fh,FILE * f_out,struct last_printed * lp) file_header_print() argument
923 file_header_read_next(struct file_header * fh) file_header_read_next() argument
947 file_headers_merge(size_t fnum,struct file_header ** fh,FILE * f_out) file_headers_merge() argument
980 struct file_header **fh; merge_files_array() local
[all...]
/openbsd-src/regress/usr.sbin/syslogd/
H A DRSyslogd.pm62 open(my $fh, '>', $self->{conffile})
65 print $fh "\$ModLoad imudp\n";
66 print $fh "\$UDPServerRun $listenport\n";
69 print $fh "\$ModLoad imtcp\n";
70 print $fh "\$InputTCPServerRun $listenport\n";
73 print $fh "\$DefaultNetstreamDriver gtls\n";
81 print $fh "\$DefaultNetstreamDriver${k}File $v\n";
83 print $fh "\$ModLoad imtcp\n";
84 print $fh "\$InputTCPServerStreamDriverMode 1\n";
85 print $fh "\$InputTCPServerStreamDriverAuthMode anon\n";
[all …]

12345678910>>...34