/macosx-10.10/ruby-106/ruby/test/scanf/ |
H A D | test_scanfio.rb | 12 fh = File.new(File.join(File.dirname(__FILE__), "data.txt"), "r") 13 assert_equal(0, fh.pos) 14 assert_equal(["this", "is"], fh.scanf("%s%s")) 15 assert_equal([33, "little"], fh.scanf("%da fun%s")) 17 fh.close
|
H A D | test_scanfblocks.rb | 54 File.open(fn, "w") { |fh| fh.puts(@str) } 55 fh = File.open(fn, "rb") 56 res = fh.scanf("%s%d") { |name, year| "#{name} was born in #{year}." } 64 fh.close 72 fh = File.open(fn,"rb") 73 assert_equal(fh.scanf("") {}, []) 74 fh.seek(0) 75 assert_equal(fh.scanf("%d%f%s") {}, []) 76 fh [all...] |
/macosx-10.10/tcl-105/tcl_ext/tcllib/tcllib/modules/png/ |
H A D | png.tcl | 17 set fh [open $file $mode] 18 fconfigure $fh -encoding binary -translation binary -eofchar {} 19 if {[read $fh 8] != "\x89PNG\r\n\x1a\n"} { close $fh; return -code error "not a png file" } 20 return $fh 24 if {[catch {_openPNG $file} fh]} { return 0 } 25 close $fh 31 if {[catch {_openPNG $file} fh]} { return SIG } 36 while {[set r [read $fh 8]] != ""} { 38 if {$len < 0} { close $fh; retur [all...] |
/macosx-10.10/postfix-255/postfix/src/tls/ |
H A D | tls_prng_file.c | 13 /* ssize_t tls_prng_file_read(fh, length) 14 /* TLS_PRNG_SRC *fh; 17 /* int tls_prng_file_close(fh) 18 /* TLS_PRNG_SRC *fh; 86 TLS_PRNG_SRC *fh; local 94 fh = (TLS_PRNG_SRC *) mymalloc(sizeof(*fh)); 95 fh->fd = fd; 96 fh->name = mystrdup(name); 97 fh 106 tls_prng_file_read(TLS_PRNG_SRC *fh, size_t len) argument 142 tls_prng_file_close(TLS_PRNG_SRC *fh) argument [all...] |
/macosx-10.10/tcl-105/tcl_ext/sdx/sdx/lib/stringfileinfo/ |
H A D | stringfileinfo.tcl | 8 proc ::stringfileinfo::getdword {fh} { 9 binary scan [read $fh 4] i* tmp 13 proc ::stringfileinfo::getword {fh} { 14 binary scan [read $fh 2] s* tmp 21 set fh [open $file r] 22 if {[read $fh 2] == "MZ" && [seek $fh 24 start] == "" && [scan [read $fh 1] %c] >= 64} { 23 seek $fh 60 start 24 seek $fh [getwor [all...] |
/macosx-10.10/tcl-105/tcl_ext/tcllib/tcllib/modules/inifile/ |
H A D | ini.tcl | 26 ::set fh ini$nexthandle 30 namespace eval ::ini::$fh { 35 ::set ::ini::${fh}::channel $tmp 36 ::set ::ini::${fh}::file [_normalize $ini] 37 ::set ::ini::${fh}::mode $mode 41 _loadfile $fh 43 return $fh 49 proc ::ini::close {fh} { 50 _valid_ns $fh 51 ::close [::set ::ini::${fh} [all...] |
/macosx-10.10/CPANInternal-159.1/IO-KQueue-0.34/examples/ |
H A D | tail.pl | 14 open(my $fh, $file) || die "$0: open($file): $!"; 17 while (<$fh>) { 28 $kq->EV_SET(fileno($fh), EVFILT_READ, EV_ADD, 0, 0, \&read_file); 29 $kq->EV_SET(fileno($fh), EVFILT_VNODE, EV_ADD, NOTE_DELETE | NOTE_RENAME, 0, \&reopen_file); 45 seek($fh, 0, 2); 49 while (<$fh>) { 56 close($fh); 57 open($fh, $file) || die "$0: $file went away\n"; 58 $kq->EV_SET(fileno($fh), EVFILT_READ, EV_ADD, 0, 0, \&read_file); 59 $kq->EV_SET(fileno($fh), EVFILT_VNOD [all...] |
/macosx-10.10/CPANInternal-159.1/Perl-Tidy-20121207/examples/ |
H A D | perllinetype.pl | 29 my ($file, $fh, $source); 35 $fh = IO::File->new( $file, 'r' ); 36 unless ($fh) { die "cannot open '$file': $!\n" } 37 $source = $fh; 57 $fh->close() if $fh;
|
/macosx-10.10/tcl-105/tcl_ext/tcllib/tcllib/modules/jpeg/ |
H A D | jpeg.tcl | 136 set fh [open $file $mode] 137 fconfigure $fh -encoding binary -translation binary -eofchar {} 139 if {[read $fh 3] != "\xFF\xD8\xFF"} { close $fh; return -code error "not a jpg file" } 141 seek $fh -1 current 142 return $fh 147 set is [catch {openJFIF $file} fh] 148 catch {close $fh} 156 proc ::jpeg::markers {fh} { 158 while {[read $fh [all...] |
/macosx-10.10/tcl-105/tcl_ext/tklib/tklib/modules/ico/ |
H A D | ico0.tcl | 285 set fh [open $file] 286 fconfigure $fh -eofchar {} -encoding binary -translation lf 289 seek $fh $ICONS($file,$i) start 292 append data [read $fh [eval calcSize $ico 40]] 294 close $fh 362 proc ::ico::getdword {fh} { 363 binary scan [read $fh 4] i* tmp 367 proc ::ico::getword {fh} { 368 binary scan [read $fh 2] s* tmp 372 proc ::ico::getulong {fh} { [all...] |
H A D | ico.tcl | 436 set fh [open $file] 437 fconfigure $fh -eofchar {} -encoding binary -translation lf 443 seek $fh $RES($file,icon,$icon,offset) start 446 append data [read $fh [eval calcSize $ico 40]] 468 close $fh 521 proc ::ico::getdword {fh} { 522 binary scan [read $fh 4] i* tmp 526 proc ::ico::getword {fh} { 527 binary scan [read $fh 2] s* tmp 531 proc ::ico::getulong {fh} { [all...] |
/macosx-10.10/CPANInternal-159.1/File-ExtAttr-1.09/t/ |
H A D | 31nsmultiple.t | 33 my ($fh, $filename) = tempfile( DIR => $TESTDIR ); 35 close $fh or die "can't close $filename $!"; 114 $fh = new IO::File("<$filename") or die "Unable to open $filename"; 116 print "# using file descriptor ".$fh->fileno()."\n"; 121 setfattr($fh, "$key", $val, { namespace => 'user' }) 122 or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; 125 is (setfattr($fh, "$key", $val, { namespace => 'user' }), 1); 128 is (getfattr($fh, "$key", { namespace => 'user' }), $val); 131 is (setfattr($fh, "$key2", $val, { namespace => 'user' }), 1); 134 is (getfattr($fh, " [all...] |
H A D | 11basic.t | 32 my ($fh, $filename) = tempfile( DIR => $TESTDIR ); 34 close $fh or die "can't close $filename $!"; 79 $fh = new IO::File("<$filename") or die "Unable to open $filename"; 81 print "# using file descriptor ".$fh->fileno()."\n"; 86 setfattr($fh, "$key", $val) 87 or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; 90 is (setfattr($fh, "$key", $val), 1); 93 is (getfattr($fh, "$key"), $val); 96 ok (delfattr($fh, "$key")); 99 is (getfattr($fh, " [all...] |
H A D | 12empty.t | 35 my ($fh, $filename) = tempfile( DIR => $TESTDIR ); 37 close $fh or die "can't close $filename $!"; 82 $fh = new IO::File("<$filename") or die "Unable to open $filename"; 84 print "# using file descriptor ".$fh->fileno()."\n"; 89 setfattr($fh, "$key", $val) 90 or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; 93 is (setfattr($fh, "$key", $val), 1); 96 is (getfattr($fh, "$key"), $val); 99 ok (delfattr($fh, "$key")); 102 is (getfattr($fh, " [all...] |
H A D | 30nsbasic.t | 32 my ($fh, $filename) = tempfile( DIR => $TESTDIR ); 34 close $fh or die "can't close $filename $!"; 95 $fh = new IO::File("<$filename") or die "Unable to open $filename"; 97 print "# using file descriptor ".$fh->fileno()."\n"; 102 setfattr($fh, "$key", $val, { namespace => 'user' }) 103 or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; 106 is (setfattr($fh, "$key", $val, { namespace => 'user' }), 1); 109 @ns = listfattrns($fh); 114 is (getfattr($fh, "$key", { namespace => 'user' }), $val); 117 ok (delfattr($fh, " [all...] |
H A D | 15create.t | 33 my ($fh, $filename) = tempfile( DIR => $TESTDIR ); 35 close $fh or die "can't close $filename $!"; 76 $fh = new IO::File("<$filename") or die "Unable to open $filename"; 78 print "# using file descriptor ".$fh->fileno()."\n"; 81 is (setfattr($fh, "$key", $val, { create => 1 }), 1); 84 my $ret = setfattr($fh, "$key", $val, { create => 1 }); 90 is (getfattr($fh, "$key"), $val); 93 ok (delfattr($fh, "$key")); 96 is (getfattr($fh, "$key"), undef);
|
H A D | 16replace.t | 32 my ($fh, $filename) = tempfile( DIR => $TESTDIR ); 34 close $fh or die "can't close $filename $!"; 75 $fh = new IO::File("<$filename") or die "Unable to open $filename"; 77 print "# using file descriptor ".$fh->fileno()."\n"; 80 is (setfattr($fh, "$key", $val, { create => 1 }), 1); 83 is (setfattr($fh, "$key", $val, { replace => 1 }), 1); 86 is (getfattr($fh, "$key"), $val); 89 ok (delfattr($fh, "$key")); 92 is (getfattr($fh, "$key"), undef);
|
H A D | 13long.t | 35 my ($fh, $filename) = tempfile( DIR => $TESTDIR ); 36 close $fh or die "can't close $filename $!"; 96 $fh = new IO::File("<$filename") or die "Unable to open $filename"; 98 print "# using file descriptor ".$fh->fileno()."\n"; 106 setfattr($fh, "$key", $longval) 107 or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; 110 is (setfattr($fh, "$key", $longval), 1); 113 is (getfattr($fh, "$key"), $longval); 116 ok (delfattr($fh, "$key")); 119 is (getfattr($fh, " [all...] |
H A D | 33nslong.t | 35 my ($fh, $filename) = tempfile( DIR => $TESTDIR ); 36 close $fh or die "can't close $filename $!"; 97 $fh = new IO::File("<$filename") or die "Unable to open $filename"; 99 print "# using file descriptor ".$fh->fileno()."\n"; 107 setfattr($fh, "$key", $longval, { namespace => 'user' }) 108 or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; 111 is (setfattr($fh, "$key", $longval, { namespace => 'user' }), 1); 114 is (getfattr($fh, "$key", { namespace => 'user' }), $longval); 117 ok (delfattr($fh, "$key", { namespace => 'user' })); 120 is (getfattr($fh, " [all...] |
H A D | 17createreplace.t | 32 my ($fh, $filename) = tempfile( DIR => $TESTDIR ); 34 close $fh or die "can't close $filename $!"; 68 $fh = new IO::File("<$filename") or die "Unable to open $filename"; 70 print "# using file descriptor ".$fh->fileno()."\n"; 76 eval { setfattr($fh, $key2, $val, { create => 1, replace => 1 }); }; 80 is (getfattr($fh, $key2), undef);
|
/macosx-10.10/tcl-105/tcl_ext/tclx/tclx/tests/ |
H A D | sync.test | 35 set fh [open SYNC.TMP w] 36 puts $fh [replicate XXX 1000] 37 sync $fh 38 close $fh
|
H A D | lgets.test | 102 set fh [open test1.tmp w] 104 puts $fh $data($idx) 106 close $fh 107 set fh [open test1.tmp] 112 lgets $fh 116 lgets $fh retvar 121 lgets $fh 125 lgets $fh retvar 130 lgets $fh 134 lgets $fh retva [all...] |
H A D | ftrunc.test | 26 set fh [open $name w] 27 puts -nonewline $fh [replicate X $size] 28 close $fh 85 set fh [open TRUNCATE.TMP r+] 86 ftruncate -fileid $fh 500 87 lappend sizes [file size TRUNCATE.TMP] [fstat $fh size] 88 ftruncate -fileid $fh 50 89 lappend sizes [file size TRUNCATE.TMP] [fstat $fh size] 90 close $fh 97 set fh [ope [all...] |
/macosx-10.10/cups-408/cups/filter/ |
H A D | raster.c | 545 cups_page_header2_t fh; /* File page header */ local 547 memset(&fh, 0, sizeof(fh)); 549 strlcpy(fh.MediaClass, "PwgRaster", sizeof(fh.MediaClass)); 551 strlcpy(fh.MediaColor, r->header.MediaColor, sizeof(fh.MediaColor)); 552 strlcpy(fh.MediaType, r->header.MediaType, sizeof(fh.MediaType)); 553 strlcpy(fh 660 cups_page_header2_t fh; /* File page header */ local [all...] |
/macosx-10.10/tcl-105/tcl_ext/tcllib/tcllib/modules/tiff/ |
H A D | tiff.tcl | 18 set fh [open $file $mode] 19 fconfigure $fh -encoding binary -translation binary -eofchar {} 20 binary scan [read $fh 2] H4 byteOrder 26 close $fh 29 _scan $byteOrder [read $fh 6] si version offset 31 close $fh 34 seek $fh $offset start 35 return $fh 39 set is [catch {openTIFF $file} fh] 40 catch {close $fh} [all...] |