home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / a_utils / perl / mac-perl / mcprl402.bin / Perl_src / t / io / pipe.t < prev    next >
MacBinary  |  1992-01-05  |  1.4 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert E-Tracker Chiptune (music/eTracker) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert Simis (archive/simis) ext Unsupported
1% dexvert TADS (other/tads) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sun Jan 5 15:39:34 1992, modified Sun Jan 5 15:39:34 1992, creator 'MPS ', type ASCII, 896 bytes "pipe.t" default (weak)
99% file a ./perl script executable (binary data), at 0x400 286 bytes resource default (weak)
98% file a ./perl script executable (binary data) default (weak)
97% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID TTComp archive compressed (bin-4K) default (weak)
16% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 70 69 70 65 2e 74 | 00 00 00 00 00 00 00 00 |..pipe.t|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 03 80 00 | 00 01 1e a5 8d 1d 86 a5 |........|........|
|00000060| 8d 1d 86 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 8c 82 00 00 |........|........|
|00000080| 23 21 2e 2f 70 65 72 6c | 0d 0d 23 20 24 48 65 61 |#!./perl|..# $Hea|
|00000090| 64 65 72 3a 20 70 69 70 | 65 2e 74 2c 76 20 34 2e |der: pip|e.t,v 4.|
|000000a0| 30 20 39 31 2f 30 33 2f | 32 30 20 30 31 3a 35 31 |0 91/03/|20 01:51|
|000000b0| 3a 30 32 20 6c 77 61 6c | 6c 20 4c 6f 63 6b 65 64 |:02 lwal|l Locked|
|000000c0| 20 24 0d 0d 24 7c 20 3d | 20 31 3b 0d 70 72 69 6e | $..$| =| 1;.prin|
|000000d0| 74 20 22 31 2e 2e 38 5c | 6e 22 3b 0d 0d 6f 70 65 |t "1..8\|n";..ope|
|000000e0| 6e 28 50 49 50 45 2c 20 | 22 7c 2d 22 29 20 7c 7c |n(PIPE, |"|-") |||
|000000f0| 20 28 65 78 65 63 20 27 | 74 72 27 2c 20 27 5b 41 | (exec '|tr', '[A|
|00000100| 2d 5a 5d 27 2c 20 27 5b | 61 2d 7a 5d 27 29 3b 0d |-Z]', '[|a-z]');.|
|00000110| 70 72 69 6e 74 20 50 49 | 50 45 20 22 4f 4b 20 31 |print PI|PE "OK 1|
|00000120| 5c 6e 22 3b 0d 70 72 69 | 6e 74 20 50 49 50 45 20 |\n";.pri|nt PIPE |
|00000130| 22 6f 6b 20 32 5c 6e 22 | 3b 0d 63 6c 6f 73 65 20 |"ok 2\n"|;.close |
|00000140| 50 49 50 45 3b 0d 0d 69 | 66 20 28 6f 70 65 6e 28 |PIPE;..i|f (open(|
|00000150| 50 49 50 45 2c 20 22 2d | 7c 22 29 29 20 7b 0d 20 |PIPE, "-||")) {. |
|00000160| 20 20 20 77 68 69 6c 65 | 28 3c 50 49 50 45 3e 29 | while|(<PIPE>)|
|00000170| 20 7b 0d 09 73 2f 5e 6e | 6f 74 20 2f 2f 3b 0d 09 | {..s/^n|ot //;..|
|00000180| 70 72 69 6e 74 3b 0d 20 | 20 20 20 7d 0d 7d 0d 65 |print;. | }.}.e|
|00000190| 6c 73 65 20 7b 0d 20 20 | 20 20 70 72 69 6e 74 20 |lse {. | print |
|000001a0| 53 54 44 4f 55 54 20 22 | 6e 6f 74 20 6f 6b 20 33 |STDOUT "|not ok 3|
|000001b0| 5c 6e 22 3b 0d 20 20 20 | 20 65 78 65 63 20 27 65 |\n";. | exec 'e|
|000001c0| 63 68 6f 27 2c 20 27 6e | 6f 74 20 6f 6b 20 34 27 |cho', 'n|ot ok 4'|
|000001d0| 3b 0d 7d 0d 0d 70 69 70 | 65 28 52 45 41 44 45 52 |;.}..pip|e(READER|
|000001e0| 2c 57 52 49 54 45 52 29 | 20 7c 7c 20 64 69 65 20 |,WRITER)| || die |
|000001f0| 22 43 61 6e 27 74 20 6f | 70 65 6e 20 70 69 70 65 |"Can't o|pen pipe|
|00000200| 22 3b 0d 0d 69 66 20 28 | 24 70 69 64 20 3d 20 66 |";..if (|$pid = f|
|00000210| 6f 72 6b 29 20 7b 0d 20 | 20 20 20 63 6c 6f 73 65 |ork) {. | close|
|00000220| 20 57 52 49 54 45 52 3b | 0d 20 20 20 20 77 68 69 | WRITER;|. whi|
|00000230| 6c 65 28 3c 52 45 41 44 | 45 52 3e 29 20 7b 0d 09 |le(<READ|ER>) {..|
|00000240| 73 2f 5e 6e 6f 74 20 2f | 2f 3b 0d 09 79 2f 41 2d |s/^not /|/;..y/A-|
|00000250| 5a 2f 61 2d 7a 2f 3b 0d | 09 70 72 69 6e 74 3b 0d |Z/a-z/;.|.print;.|
|00000260| 20 20 20 20 7d 0d 7d 0d | 65 6c 73 65 20 7b 0d 20 | }.}.|else {. |
|00000270| 20 20 20 64 69 65 20 22 | 43 6f 75 6c 64 6e 27 74 | die "|Couldn't|
|00000280| 20 66 6f 72 6b 22 20 75 | 6e 6c 65 73 73 20 64 65 | fork" u|nless de|
|00000290| 66 69 6e 65 64 20 24 70 | 69 64 3b 0d 20 20 20 20 |fined $p|id;. |
|000002a0| 63 6c 6f 73 65 20 52 45 | 41 44 45 52 3b 0d 20 20 |close RE|ADER;. |
|000002b0| 20 20 70 72 69 6e 74 20 | 57 52 49 54 45 52 20 22 | print |WRITER "|
|000002c0| 6e 6f 74 20 6f 6b 20 35 | 5c 6e 22 3b 0d 20 20 20 |not ok 5|\n";. |
|000002d0| 20 6f 70 65 6e 28 53 54 | 44 4f 55 54 2c 22 3e 26 | open(ST|DOUT,">&|
|000002e0| 57 52 49 54 45 52 22 29 | 20 7c 7c 20 64 69 65 20 |WRITER")| || die |
|000002f0| 22 43 61 6e 27 74 20 64 | 75 70 20 57 52 49 54 45 |"Can't d|up WRITE|
|00000300| 52 20 74 6f 20 53 54 44 | 4f 55 54 22 3b 0d 20 20 |R to STD|OUT";. |
|00000310| 20 20 63 6c 6f 73 65 20 | 57 52 49 54 45 52 3b 0d | close |WRITER;.|
|00000320| 20 20 20 20 65 78 65 63 | 20 27 65 63 68 6f 27 2c | exec| 'echo',|
|00000330| 20 27 6e 6f 74 20 6f 6b | 20 36 27 3b 0d 7d 0d 0d | 'not ok| 6';.}..|
|00000340| 0d 70 69 70 65 28 52 45 | 41 44 45 52 2c 57 52 49 |.pipe(RE|ADER,WRI|
|00000350| 54 45 52 29 20 7c 7c 20 | 64 69 65 20 22 43 61 6e |TER) || |die "Can|
|00000360| 27 74 20 6f 70 65 6e 20 | 70 69 70 65 22 3b 0d 63 |'t open |pipe";.c|
|00000370| 6c 6f 73 65 20 52 45 41 | 44 45 52 3b 0d 0d 24 53 |lose REA|DER;..$S|
|00000380| 49 47 7b 27 50 49 50 45 | 27 7d 20 3d 20 27 62 72 |IG{'PIPE|'} = 'br|
|00000390| 6f 6b 65 6e 5f 70 69 70 | 65 27 3b 0d 0d 73 75 62 |oken_pip|e';..sub|
|000003a0| 20 62 72 6f 6b 65 6e 5f | 70 69 70 65 20 7b 0d 20 | broken_|pipe {. |
|000003b0| 20 20 20 70 72 69 6e 74 | 20 22 6f 6b 20 37 5c 6e | print| "ok 7\n|
|000003c0| 22 3b 0d 7d 0d 0d 70 72 | 69 6e 74 20 57 52 49 54 |";.}..pr|int WRIT|
|000003d0| 45 52 20 22 6e 6f 74 20 | 6f 6b 20 37 5c 6e 22 3b |ER "not |ok 7\n";|
|000003e0| 0d 63 6c 6f 73 65 20 57 | 52 49 54 45 52 3b 0d 0d |.close W|RITER;..|
|000003f0| 70 72 69 6e 74 20 22 6f | 6b 20 38 5c 6e 22 3b 0d |print "o|k 8\n";.|
|00000400| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000410| 00 00 07 be 09 75 70 64 | 61 74 65 2e 70 6c 02 00 |.....upd|ate.pl..|
|00000420| 00 00 54 45 58 54 4d 50 | 53 20 01 00 05 c0 01 40 |..TEXTMP|S .....@|
|00000430| 06 70 69 70 65 2e 74 da | 02 00 00 00 54 45 58 54 |.pipe.t.|....TEXT|
|00000440| 4d 50 53 20 00 00 00 00 | 00 00 00 00 00 00 75 70 |MPS ....|......up|
|00000450| 00 00 54 45 58 54 4d 50 | 53 20 00 00 00 00 00 00 |..TEXTMP|S ......|
|00000460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000470| 00 00 a5 8b b4 0c 00 00 | 03 80 00 00 01 1e 00 00 |........|........|
|00000480| 00 00 00 00 0f 00 00 00 | 07 be 09 75 73 65 72 73 |........|...users|
|00000490| 75 62 2e 63 02 00 00 00 | 54 45 58 54 00 00 00 00 |ub.c....|TEXT....|
|000004a0| 01 00 06 00 00 00 00 00 | 00 00 12 2b 00 00 00 00 |........|...+....|
|000004b0| 0a e3 00 00 10 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004c0| a5 8c 0b c1 a5 8c 0b c2 | 00 00 00 00 00 00 00 00 |........|........|
|000004d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 1c 07 |........|........|
|000004e0| 00 02 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 0f 00 |........|........|
|00000500| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000510| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|00000520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+