home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / unix_c / tapes / cpio.tar < prev    next >
Tape Archive  |  1989-03-04  |  16.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Tape Archive (archive/tar).

You can browse this item here: cpio.tar

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Tape Archive (archive/tar) magic Supported
100% file tar archive default
99% file tar archive (V7), file cpio/, mode 755 , uid 243 , gid 12 , size 0 , seconds 4404062424 default
98% file data default
100% TrID Sybase iAnywhere database files default (weak)
100% siegfried x-fmt/265 Tape Archive Format default
100% lsar Tar default
100% gt2 TAR Archiv gefunden (Auflistung ist deaktiviert) default
100% disktype Pre-POSIX tar archive default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 63 70 69 6f 2f 00 00 00 | 00 00 00 00 00 00 00 00 |cpio/...|........|
|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 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 20 20 37 | 35 35 20 00 20 20 20 32 |.... 7|55 . 2|
|00000070| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 34 34 30 34 30 36 32 | 0 | 4404062|
|00000090| 34 32 34 20 20 20 34 37 | 34 35 00 20 00 00 00 00 |424 47|45. ....|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 63 70 69 6f 2f 53 68 61 | 72 46 69 6c 65 2e 48 65 |cpio/Sha|rFile.He|
|00000210| 61 64 65 72 73 00 00 00 | 00 00 00 00 00 00 00 00 |aders...|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00000270| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00000280| 20 20 20 31 33 32 35 20 | 20 34 34 30 34 30 36 32 | 1325 | 4404062|
|00000290| 34 33 31 20 20 31 30 30 | 32 33 00 20 00 00 00 00 |431 100|23. ....|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 3d 3d 3d 20 63 70 69 6f | 2e 73 68 61 72 20 3d 3d |=== cpio|.shar ==|
|00000410| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000420| 3d 3d 3d 3d 3d 3d 3d 0a | 46 72 6f 6d 3a 20 52 6f |=======.|From: Ro|
|00000430| 79 20 53 6d 69 74 68 20 | 3c 76 61 78 31 33 35 21 |y Smith |<vax135!|
|00000440| 74 69 6d 65 69 6e 63 21 | 70 68 72 69 21 72 6f 79 |timeinc!|phri!roy|
|00000450| 40 55 63 62 2d 56 61 78 | 2e 41 52 50 41 3e 0a 54 |@Ucb-Vax|.ARPA>.T|
|00000460| 6f 3a 20 6e 65 74 2e 73 | 6f 75 72 63 65 73 0a 53 |o: net.s|ources.S|
|00000470| 75 62 6a 65 63 74 3a 20 | 50 75 62 6c 69 63 20 44 |ubject: |Public D|
|00000480| 6f 6d 61 69 6e 20 63 70 | 69 6f 20 61 76 61 69 6c |omain cp|io avail|
|00000490| 61 62 6c 65 0a 44 61 74 | 65 3a 20 34 20 4d 61 79 |able.Dat|e: 4 May|
|000004a0| 20 38 35 20 30 32 3a 32 | 30 3a 32 32 20 47 4d 54 | 85 02:2|0:22 GMT|
|000004b0| 0a 0a 3e 20 09 54 68 65 | 20 62 6f 74 74 6f 6d 20 |..> .The| bottom |
|000004c0| 6c 69 6e 65 20 69 73 20 | 74 68 61 74 20 49 20 68 |line is |that I h|
|000004d0| 61 76 65 20 61 20 70 72 | 6f 67 72 61 6d 20 77 68 |ave a pr|ogram wh|
|000004e0| 69 63 68 20 72 65 61 64 | 73 20 63 70 69 6f 20 74 |ich read|s cpio t|
|000004f0| 61 70 65 73 0a 3e 20 77 | 68 69 63 68 20 49 20 77 |apes.> w|hich I w|
|00000500| 72 6f 74 65 20 6d 79 73 | 65 6c 66 20 77 6f 72 6b |rote mys|elf work|
|00000510| 69 6e 67 20 6f 6e 6c 79 | 20 66 72 6f 6d 20 74 68 |ing only| from th|
|00000520| 65 20 64 6f 63 75 6d 65 | 6e 74 61 74 69 6f 6e 20 |e docume|ntation |
|00000530| 28 74 68 61 74 20 6d 61 | 6b 65 73 20 69 74 0a 3e |(that ma|kes it.>|
|00000540| 20 70 75 62 6c 69 63 20 | 64 6f 6d 61 69 6e 2c 20 | public |domain, |
|00000550| 79 65 73 3f 29 2e 20 20 | 49 66 20 61 6e 79 62 6f |yes?). |If anybo|
|00000560| 64 79 20 77 61 6e 74 73 | 20 69 74 2c 20 69 74 27 |dy wants| it, it'|
|00000570| 73 20 79 6f 75 72 73 20 | 66 6f 72 20 74 68 65 20 |s yours |for the |
|00000580| 61 73 6b 69 6e 67 2e 0a | 0a 57 65 6c 6c 2c 20 66 |asking..|.Well, f|
|00000590| 6f 6c 6b 73 2e 2e 2e 20 | 68 65 72 65 20 69 74 20 |olks... |here it |
|000005a0| 69 73 3a 0a 0a 2d 2d 2d | 2d 2d 2d 54 61 6b 65 74 |is:..---|---Taket|
|000005b0| 68 20 61 6c 6c 20 74 68 | 61 74 20 6c 69 65 73 20 |h all th|at lies |
|000005c0| 61 62 6f 76 65 20 74 68 | 69 73 20 6c 69 6e 65 2c |above th|is line,|
|000005d0| 20 61 6e 64 20 63 61 73 | 74 20 69 74 20 69 6e 74 | and cas|t it int|
|000005e0| 6f 20 74 68 65 20 76 6f | 69 64 2d 2d 2d 2d 2d 0a |o the vo|id-----.|
|000005f0| 0a 23 20 54 68 69 73 20 | 69 73 20 61 20 73 68 65 |.# This |is a she|
|00000600| 6c 6c 20 61 72 63 68 69 | 76 65 2e 20 20 52 65 6d |ll archi|ve. Rem|
|00000610| 6f 76 65 20 61 6e 79 74 | 68 69 6e 67 20 62 65 66 |ove anyt|hing bef|
|00000620| 6f 72 65 20 74 68 69 73 | 20 6c 69 6e 65 2c 0a 23 |ore this| line,.#|
|00000630| 20 74 68 65 6e 20 75 6e | 70 61 63 6b 20 69 74 20 | then un|pack it |
|00000640| 62 79 20 73 61 76 69 6e | 67 20 69 74 20 69 6e 20 |by savin|g it in |
|00000650| 61 20 66 69 6c 65 20 61 | 6e 64 20 74 79 70 69 6e |a file a|nd typin|
|00000660| 67 20 22 73 68 20 66 69 | 6c 65 22 2e 0a 23 0a 23 |g "sh fi|le"..#.#|
|00000670| 20 57 72 61 70 70 65 64 | 20 62 79 20 70 68 72 69 | Wrapped| by phri|
|00000680| 21 72 6f 79 20 6f 6e 20 | 46 72 69 20 4d 61 79 20 |!roy on |Fri May |
|00000690| 20 33 20 32 32 3a 30 39 | 3a 30 30 20 45 44 54 20 | 3 22:09|:00 EDT |
|000006a0| 31 39 38 35 0a 23 20 43 | 6f 6e 74 65 6e 74 73 3a |1985.# C|ontents:|
|000006b0| 20 20 52 45 41 44 5f 4d | 45 20 63 70 69 6f 6c 69 | READ_M|E cpioli|
|000006c0| 73 74 2e 63 20 63 70 69 | 6f 65 78 74 72 61 63 74 |st.c cpi|oextract|
|000006d0| 2e 63 0a 20 0a 00 00 00 | 00 00 00 00 00 00 00 00 |.c. ....|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000800| 63 70 69 6f 2f 52 45 41 | 44 5f 4d 45 00 00 00 00 |cpio/REA|D_ME....|
|00000810| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00000870| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00000880| 20 20 20 34 37 30 30 20 | 20 34 34 30 34 30 36 32 | 4700 | 4404062|
|00000890| 34 32 30 20 20 20 36 30 | 34 36 00 20 00 00 00 00 |420 60|46. ....|
|000008a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a00| 09 57 68 61 74 20 77 65 | 20 68 61 76 65 20 68 65 |.What we| have he|
|00000a10| 72 65 20 69 73 20 61 20 | 73 74 72 69 70 70 65 64 |re is a |stripped|
|00000a20| 2d 64 6f 77 6e 20 70 61 | 69 72 20 6f 66 20 70 72 |-down pa|ir of pr|
|00000a30| 6f 67 72 61 6d 73 20 77 | 68 69 63 68 20 63 61 6e |ograms w|hich can|
|00000a40| 2c 20 69 6e 0a 74 68 65 | 20 62 61 72 65 73 74 20 |, in.the| barest |
|00000a50| 6d 61 72 67 69 6e 61 6c | 20 73 65 6e 73 65 2c 20 |marginal| sense, |
|00000a60| 61 6c 6c 6f 77 20 79 6f | 75 20 74 6f 20 72 65 61 |allow yo|u to rea|
|00000a70| 64 20 63 70 69 6f 20 74 | 61 70 65 73 2e 20 20 54 |d cpio t|apes. T|
|00000a80| 68 65 79 20 77 65 72 65 | 20 77 72 69 74 74 65 6e |hey were| written|
|00000a90| 0a 66 6f 72 20 6f 6e 65 | 20 70 61 72 74 69 63 75 |.for one| particu|
|00000aa0| 6c 61 72 20 70 75 72 70 | 6f 73 65 20 77 69 74 68 |lar purp|ose with|
|00000ab0| 6f 75 74 20 74 68 65 20 | 65 78 70 65 63 74 61 74 |out the |expectat|
|00000ac0| 69 6f 6e 20 74 68 61 74 | 20 74 68 65 79 20 77 6f |ion that| they wo|
|00000ad0| 75 6c 64 20 65 76 65 72 | 20 62 65 0a 75 73 65 64 |uld ever| be.used|
|00000ae0| 20 61 67 61 69 6e 2c 20 | 73 6f 20 6e 6f 20 61 74 | again, |so no at|
|00000af0| 74 65 6d 70 74 20 77 61 | 73 20 6d 61 64 65 20 74 |tempt wa|s made t|
|00000b00| 6f 20 73 75 70 70 6f 72 | 74 20 61 6e 79 20 66 75 |o suppor|t any fu|
|00000b10| 6e 63 74 69 6f 6e 61 6c | 69 74 79 20 62 65 79 6f |nctional|ity beyo|
|00000b20| 6e 64 20 74 68 65 0a 64 | 65 61 64 20 6d 69 6e 69 |nd the.d|ead mini|
|00000b30| 6d 75 6d 2e 0a 0a 09 54 | 68 65 20 72 65 61 73 6f |mum....T|he reaso|
|00000b40| 6e 20 49 20 77 72 6f 74 | 65 20 74 68 65 73 65 20 |n I wrot|e these |
|00000b50| 70 72 6f 67 72 61 6d 73 | 20 77 61 73 20 74 6f 20 |programs| was to |
|00000b60| 62 65 20 61 62 6c 65 20 | 74 6f 20 72 65 61 64 20 |be able |to read |
|00000b70| 6d 79 20 53 79 73 35 0a | 64 69 73 74 72 69 62 75 |my Sys5.|distribu|
|00000b80| 74 69 6f 6e 20 74 61 70 | 65 73 20 6f 6e 20 6d 79 |tion tap|es on my|
|00000b90| 20 34 2e 32 20 62 73 64 | 20 73 79 73 74 65 6d 2e | 4.2 bsd| system.|
|00000ba0| 20 20 54 68 65 20 69 64 | 65 61 20 77 61 73 20 74 | The id|ea was t|
|00000bb0| 68 61 74 20 49 20 77 6f | 75 6c 64 20 75 73 65 0a |hat I wo|uld use.|
|00000bc0| 63 70 69 6f 6c 69 73 74 | 20 74 6f 20 67 65 74 20 |cpiolist| to get |
|00000bd0| 61 20 6c 69 73 74 69 6e | 67 20 6f 66 20 61 6c 6c |a listin|g of all|
|00000be0| 20 74 68 65 20 66 69 6c | 65 73 20 6f 6e 20 74 68 | the fil|es on th|
|00000bf0| 65 20 2f 75 73 72 20 66 | 69 6c 65 20 73 79 73 74 |e /usr f|ile syst|
|00000c00| 65 6d 2c 20 61 6e 64 0a | 74 68 65 6e 20 28 6f 6e |em, and.|then (on|
|00000c10| 63 65 20 49 20 6b 6e 65 | 77 20 74 68 65 20 6e 61 |ce I kne|w the na|
|00000c20| 6d 65 73 20 6f 66 20 74 | 68 65 20 72 65 71 75 69 |mes of t|he requi|
|00000c30| 72 65 64 20 66 69 6c 65 | 73 29 20 75 73 65 20 63 |red file|s) use c|
|00000c40| 70 69 6f 65 78 74 72 61 | 63 74 20 74 6f 20 70 75 |pioextra|ct to pu|
|00000c50| 6c 6c 0a 6f 66 66 20 74 | 68 65 20 73 6f 75 72 63 |ll.off t|he sourc|
|00000c60| 65 20 66 6f 72 20 74 68 | 65 20 27 72 65 61 6c 27 |e for th|e 'real'|
|00000c70| 20 63 70 69 6f 2c 20 63 | 6f 6d 70 69 6c 65 20 74 | cpio, c|ompile t|
|00000c80| 68 61 74 20 75 6e 64 65 | 72 20 34 2e 32 2c 20 61 |hat unde|r 4.2, a|
|00000c90| 6e 64 20 75 73 65 20 69 | 74 20 74 6f 0a 64 6f 20 |nd use i|t to.do |
|00000ca0| 74 68 65 20 72 65 73 74 | 20 6f 66 20 74 68 65 20 |the rest| of the |
|00000cb0| 6a 6f 62 20 63 6f 72 72 | 65 63 74 6c 79 2e 20 20 |job corr|ectly. |
|00000cc0| 4e 6f 74 69 63 65 20 33 | 20 69 6d 70 6f 72 74 61 |Notice 3| importa|
|00000cd0| 6e 74 20 74 68 69 6e 67 | 73 2e 20 20 46 69 72 73 |nt thing|s. Firs|
|00000ce0| 74 2c 0a 63 70 69 6f 65 | 78 74 72 61 63 74 20 6f |t,.cpioe|xtract o|
|00000cf0| 6e 6c 79 20 65 78 74 72 | 61 63 74 73 20 61 20 73 |nly extr|acts a s|
|00000d00| 69 6e 67 6c 65 20 66 69 | 6c 65 20 70 65 72 20 69 |ingle fi|le per i|
|00000d10| 6e 76 6f 63 61 74 69 6f | 6e 2e 20 20 53 65 63 6f |nvocatio|n. Seco|
|00000d20| 6e 64 2c 20 69 74 20 65 | 78 70 65 63 74 73 0a 61 |nd, it e|xpects.a|
|00000d30| 6c 6c 20 6f 66 20 74 68 | 65 20 64 69 72 65 63 74 |ll of th|e direct|
|00000d40| 6f 72 69 65 73 20 61 6c | 6f 6e 67 20 74 68 65 20 |ories al|ong the |
|00000d50| 70 61 74 68 20 74 6f 20 | 74 68 61 74 20 66 69 6c |path to |that fil|
|00000d60| 65 20 74 6f 20 62 65 20 | 63 72 65 61 74 65 64 20 |e to be |created |
|00000d70| 61 6c 72 65 61 64 79 2e | 0a 54 68 69 72 64 2c 20 |already.|.Third, |
|00000d80| 74 68 65 73 65 20 70 72 | 6f 67 72 61 6d 73 20 6f |these pr|ograms o|
|00000d90| 6e 6c 79 20 6b 6e 6f 77 | 20 61 62 6f 75 74 20 62 |nly know| about b|
|00000da0| 69 6e 61 72 79 20 68 65 | 61 64 65 72 20 74 79 70 |inary he|ader typ|
|00000db0| 65 20 63 70 69 6f 20 61 | 72 63 68 69 76 65 73 0a |e cpio a|rchives.|
|00000dc0| 28 69 2e 65 2e 20 74 61 | 70 65 73 20 6d 61 64 65 |(i.e. ta|pes made|
|00000dd0| 20 57 49 54 48 4f 55 54 | 20 74 68 65 20 2d 63 20 | WITHOUT| the -c |
|00000de0| 66 6c 61 67 29 2e 20 20 | 54 68 69 73 20 69 73 20 |flag). |This is |
|00000df0| 74 68 65 20 77 61 79 20 | 74 68 65 20 53 79 73 35 |the way |the Sys5|
|00000e00| 0a 64 69 73 74 72 69 62 | 75 74 69 6f 6e 20 77 61 |.distrib|ution wa|
|00000e10| 73 20 64 6f 6e 65 20 28 | 61 74 20 6c 65 61 73 74 |s done (|at least|
|00000e20| 20 74 68 65 20 64 69 73 | 74 72 69 62 75 74 69 6f | the dis|tributio|
|00000e30| 6e 20 49 20 67 6f 74 29 | 2e 0a 0a 09 56 61 72 69 |n I got)|....Vari|
|00000e40| 6f 75 73 20 63 61 76 65 | 61 74 73 3a 20 20 54 68 |ous cave|ats: Th|
|00000e50| 65 73 65 20 70 72 6f 67 | 72 61 6d 73 20 77 65 72 |ese prog|rams wer|
|00000e60| 65 20 77 72 69 74 74 65 | 6e 20 66 72 6f 6d 20 74 |e writte|n from t|
|00000e70| 68 65 20 53 79 73 20 35 | 0a 64 6f 63 75 6d 65 6e |he Sys 5|.documen|
|00000e80| 74 61 74 69 6f 6e 20 64 | 65 73 63 72 69 62 69 6e |tation d|escribin|
|00000e90| 67 20 74 68 65 20 63 70 | 69 6f 20 66 69 6c 65 20 |g the cp|io file |
|00000ea0| 66 6f 72 6d 61 74 73 2e | 20 20 46 72 6f 6d 20 77 |formats.| From w|
|00000eb0| 68 61 74 20 49 20 63 61 | 6e 20 67 61 74 68 65 72 |hat I ca|n gather|
|00000ec0| 2c 0a 73 69 6e 63 65 20 | 49 20 64 69 64 20 6e 6f |,.since |I did no|
|00000ed0| 74 20 6c 6f 6f 6b 20 61 | 74 20 74 68 65 20 53 79 |t look a|t the Sy|
|00000ee0| 73 20 35 20 63 70 69 6f | 20 73 6f 75 72 63 65 73 |s 5 cpio| sources|
|00000ef0| 20 77 68 69 6c 65 20 49 | 20 77 61 73 20 77 72 69 | while I| was wri|
|00000f00| 74 69 6e 67 20 74 68 69 | 73 2c 20 69 74 0a 73 68 |ting thi|s, it.sh|
|00000f10| 6f 75 6c 64 20 71 75 61 | 6c 69 66 79 20 61 73 20 |ould qua|lify as |
|00000f20| 70 75 62 6c 69 63 20 64 | 6f 6d 61 69 6e 2e 20 20 |public d|omain. |
|00000f30| 54 68 65 20 70 72 69 6d | 61 72 79 20 70 75 72 70 |The prim|ary purp|
|00000f40| 6f 73 65 20 6f 66 20 74 | 68 65 73 65 20 70 72 6f |ose of t|hese pro|
|00000f50| 67 72 61 6d 73 20 69 73 | 0a 74 6f 20 62 6f 6f 74 |grams is|.to boot|
|00000f60| 73 74 72 61 70 20 61 20 | 66 75 6c 6c 2d 66 6c 65 |strap a |full-fle|
|00000f70| 64 67 65 64 20 63 70 69 | 6f 20 66 72 6f 6d 20 61 |dged cpi|o from a|
|00000f80| 20 53 79 73 20 35 20 64 | 69 73 74 72 69 62 75 74 | Sys 5 d|istribut|
|00000f90| 69 6f 6e 20 74 61 70 65 | 20 6f 6e 74 6f 20 61 0a |ion tape| onto a.|
|00000fa0| 73 79 73 74 65 6d 20 77 | 68 69 63 68 20 64 6f 65 |system w|hich doe|
|00000fb0| 73 6e 27 74 20 68 61 76 | 65 20 63 70 69 6f 20 61 |sn't hav|e cpio a|
|00000fc0| 6c 72 65 61 64 79 20 28 | 69 2e 65 2e 20 34 2e 32 |lready (|i.e. 4.2|
|00000fd0| 20 62 73 64 29 2e 20 20 | 48 61 76 69 6e 67 20 74 | bsd). |Having t|
|00000fe0| 68 65 73 65 0a 70 72 6f | 67 72 61 6d 73 20 77 69 |hese.pro|grams wi|
|00000ff0| 6c 6c 20 67 69 76 65 20 | 79 6f 75 20 74 68 65 20 |ll give |you the |
|00001000| 74 65 63 68 6e 69 63 61 | 6c 20 6d 65 61 6e 73 20 |technica|l means |
|00001010| 6f 66 20 64 6f 69 6e 67 | 20 74 68 69 73 3b 20 69 |of doing| this; i|
|00001020| 74 20 6d 61 79 20 6e 6f | 74 20 67 69 76 65 0a 79 |t may no|t give.y|
|00001030| 6f 75 20 74 68 65 20 6c | 65 67 61 6c 20 72 69 67 |ou the l|egal rig|
|00001040| 68 74 2e 20 20 49 20 61 | 6d 20 66 61 72 20 66 72 |ht. I a|m far fr|
|00001050| 6f 6d 20 71 75 61 6c 69 | 66 69 65 64 20 74 6f 20 |om quali|fied to |
|00001060| 70 61 73 73 20 6a 75 64 | 67 65 6d 65 6e 74 20 6f |pass jud|gement o|
|00001070| 6e 20 74 68 65 0a 69 73 | 73 75 65 73 20 6f 66 20 |n the.is|sues of |
|00001080| 77 68 61 74 20 61 20 70 | 61 72 74 69 63 75 6c 61 |what a p|articula|
|00001090| 72 20 55 6e 69 78 20 28 | 74 6d 29 20 6c 69 63 65 |r Unix (|tm) lice|
|000010a0| 6e 73 65 20 61 6c 6c 6f | 77 20 79 6f 75 20 74 6f |nse allo|w you to|
|000010b0| 20 64 6f 2e 20 20 55 73 | 65 20 74 68 65 73 65 0a | do. Us|e these.|
|000010c0| 70 72 6f 67 72 61 6d 73 | 20 61 74 20 79 6f 75 72 |programs| at your|
|000010d0| 20 6f 77 6e 20 72 69 73 | 6b 2e 20 20 41 6c 6c 20 | own ris|k. All |
|000010e0| 49 20 77 69 6c 6c 20 73 | 61 79 20 69 73 20 74 68 |I will s|ay is th|
|000010f0| 61 74 20 61 73 20 61 20 | 68 6f 6c 64 65 72 20 6f |at as a |holder o|
|00001100| 66 20 62 6f 74 68 20 53 | 79 73 0a 35 20 61 6e 64 |f both S|ys.5 and|
|00001110| 20 34 2e 32 20 62 73 64 | 20 73 6f 75 72 63 65 20 | 4.2 bsd| source |
|00001120| 6c 69 63 65 6e 73 65 73 | 2c 20 49 20 61 6d 20 61 |licenses|, I am a|
|00001130| 6c 6c 6f 77 65 64 20 74 | 6f 20 70 6f 72 74 20 74 |llowed t|o port t|
|00001140| 68 65 20 53 79 73 20 35 | 20 75 74 69 6c 69 74 69 |he Sys 5| utiliti|
|00001150| 65 73 20 74 6f 0a 6d 79 | 20 34 2e 32 20 73 79 73 |es to.my| 4.2 sys|
|00001160| 74 65 6d 2e 20 20 49 66 | 20 79 6f 75 20 64 6f 6e |tem. If| you don|
|00001170| 27 74 20 68 6f 6c 64 20 | 62 6f 74 68 20 6c 69 63 |'t hold |both lic|
|00001180| 65 6e 73 65 73 2c 20 79 | 6f 75 20 70 72 6f 62 61 |enses, y|ou proba|
|00001190| 62 6c 79 20 61 72 65 6e | 27 74 2e 0a 0a 09 45 76 |bly aren|'t....Ev|
|000011a0| 65 6e 74 75 61 6c 6c 79 | 2c 20 49 20 77 69 6c 6c |entually|, I will|
|000011b0| 20 67 65 74 20 61 72 6f | 75 6e 64 20 74 6f 20 61 | get aro|und to a|
|000011c0| 64 64 69 6e 67 20 6d 6f | 72 65 20 66 75 6e 63 74 |dding mo|re funct|
|000011d0| 69 6f 6e 61 6c 69 74 79 | 20 74 6f 20 74 68 65 73 |ionality| to thes|
|000011e0| 65 0a 70 72 6f 67 72 61 | 6d 73 2e 20 20 54 68 65 |e.progra|ms. The|
|000011f0| 20 74 6f 70 20 6f 66 20 | 74 68 65 20 6c 69 73 74 | top of |the list|
|00001200| 20 66 65 61 74 75 72 65 | 73 20 61 72 65 20 74 68 | feature|s are th|
|00001210| 65 20 27 2d 63 27 20 61 | 6e 64 20 27 2d 64 27 20 |e '-c' a|nd '-d' |
|00001220| 66 6c 61 67 73 2c 20 61 | 6e 64 0a 74 68 65 6e 20 |flags, a|nd.then |
|00001230| 70 61 74 74 65 72 6e 20 | 6d 61 74 63 68 69 6e 67 |pattern |matching|
|00001240| 20 66 6f 72 20 66 69 6c | 65 20 6e 61 6d 65 73 2e | for fil|e names.|
|00001250| 20 20 49 66 20 49 20 65 | 76 65 72 20 67 65 74 20 | If I e|ver get |
|00001260| 61 72 6f 75 6e 64 20 74 | 6f 20 64 6f 69 6e 67 20 |around t|o doing |
|00001270| 74 68 6f 73 65 2c 0a 49 | 27 6c 6c 20 70 6f 73 74 |those,.I|'ll post|
|00001280| 20 74 68 65 20 75 70 64 | 61 74 65 64 20 76 65 72 | the upd|ated ver|
|00001290| 73 69 6f 6e 73 2e 20 20 | 49 66 20 79 6f 75 20 66 |sions. |If you f|
|000012a0| 69 6e 64 20 61 6e 79 20 | 70 72 6f 62 6c 65 6d 73 |ind any |problems|
|000012b0| 20 77 69 74 68 20 65 69 | 74 68 65 72 20 6f 66 0a | with ei|ther of.|
|000012c0| 74 68 65 73 65 20 70 72 | 6f 67 72 61 6d 73 2c 20 |these pr|ograms, |
|000012d0| 70 6c 65 61 73 65 20 66 | 65 65 6c 20 66 72 65 65 |please f|eel free|
|000012e0| 20 74 6f 20 63 6f 6e 74 | 61 63 74 20 6d 65 2e 20 | to cont|act me. |
|000012f0| 20 49 27 6c 6c 20 62 65 | 20 68 61 70 70 79 20 74 | I'll be| happy t|
|00001300| 6f 20 68 65 6c 70 20 69 | 66 20 49 0a 63 61 6e 2c |o help i|f I.can,|
|00001310| 20 62 75 74 20 70 6c 65 | 61 73 65 20 64 6f 6e 27 | but ple|ase don'|
|00001320| 74 20 65 78 70 65 63 74 | 20 6d 65 20 74 6f 20 68 |t expect| me to h|
|00001330| 61 76 65 20 74 68 65 20 | 75 70 64 61 74 65 64 20 |ave the |updated |
|00001340| 76 65 72 73 69 6f 6e 73 | 20 72 65 61 64 79 20 6f |versions| ready o|
|00001350| 6e 20 61 6e 79 0a 70 61 | 72 74 69 63 75 6c 61 72 |n any.pa|rticular|
|00001360| 20 73 63 68 65 64 75 6c | 65 2e 0a 0a 61 6c 6c 65 | schedul|e...alle|
|00001370| 67 72 61 21 70 68 72 69 | 21 72 6f 79 20 28 52 6f |gra!phri|!roy (Ro|
|00001380| 79 20 53 6d 69 74 68 29 | 0a 53 79 73 74 65 6d 20 |y Smith)|.System |
|00001390| 41 64 6d 69 6e 69 73 74 | 72 61 74 6f 72 2c 20 50 |Administ|rator, P|
|000013a0| 75 62 6c 69 63 20 48 65 | 61 6c 74 68 20 52 65 73 |ublic He|alth Res|
|000013b0| 65 61 72 63 68 20 49 6e | 73 74 69 74 75 74 65 0a |earch In|stitute.|
|000013c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001400| 63 70 69 6f 2f 63 70 69 | 6f 6c 69 73 74 2e 63 00 |cpio/cpi|olist.c.|
|00001410| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001460| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00001470| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00001480| 20 20 20 34 32 34 32 20 | 20 34 34 30 34 30 36 32 | 4242 | 4404062|
|00001490| 34 32 33 20 20 20 37 30 | 32 35 00 20 00 00 00 00 |423 70|25. ....|
|000014a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001500| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000015a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000015b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000015c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000015d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000015e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000015f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001600| 2f 2a 0a 20 2a 20 43 70 | 69 6f 6c 69 73 74 2e 63 |/*. * Cp|iolist.c|
|00001610| 20 2d 2d 20 6c 69 73 74 | 20 61 20 63 70 69 6f 20 | -- list| a cpio |
|00001620| 74 61 70 65 20 77 72 69 | 74 74 65 6e 20 77 69 74 |tape wri|tten wit|
|00001630| 68 20 62 69 6e 61 72 79 | 20 68 65 61 64 65 72 73 |h binary| headers|
|00001640| 0a 20 2a 20 28 69 2e 65 | 2e 20 77 72 69 74 74 65 |. * (i.e|. writte|
|00001650| 6e 20 77 69 74 68 6f 75 | 74 20 74 68 65 20 2d 63 |n withou|t the -c|
|00001660| 20 6f 70 74 69 6f 6e 29 | 2e 20 20 55 73 61 67 65 | option)|. Usage|
|00001670| 20 69 73 20 22 63 70 69 | 6f 6c 69 73 74 20 66 69 | is "cpi|olist fi|
|00001680| 6c 65 22 0a 20 2a 20 77 | 68 65 72 65 20 27 66 69 |le". * w|here 'fi|
|00001690| 6c 65 27 20 69 73 20 74 | 68 65 20 63 70 69 6f 20 |le' is t|he cpio |
|000016a0| 61 72 63 68 69 76 65 20 | 28 70 72 6f 62 61 62 6c |archive |(probabl|
|000016b0| 79 20 2f 64 65 76 2f 72 | 6d 74 31 32 29 2e 0a 20 |y /dev/r|mt12).. |
|000016c0| 2a 0a 20 2a 20 57 72 69 | 74 65 6e 2c 20 70 72 6f |*. * Wri|ten, pro|
|000016d0| 64 75 63 65 64 2c 20 61 | 6e 64 20 64 69 72 65 63 |duced, a|nd direc|
|000016e0| 74 65 64 20 62 79 3a 0a | 20 2a 20 52 6f 79 20 53 |ted by:.| * Roy S|
|000016f0| 6d 69 74 68 20 3c 61 6c | 6c 65 67 72 61 21 70 68 |mith <al|legra!ph|
|00001700| 72 69 21 72 6f 79 3e 0a | 20 2a 20 54 68 65 20 50 |ri!roy>.| * The P|
|00001710| 75 62 6c 69 63 20 48 65 | 61 6c 74 68 20 52 65 73 |ublic He|alth Res|
|00001720| 65 61 72 63 68 20 49 6e | 73 74 69 74 75 74 65 0a |earch In|stitute.|
|00001730| 20 2a 20 20 20 6f 66 20 | 74 68 65 20 43 69 74 79 | * of |the City|
|00001740| 20 6f 66 20 4e 65 77 20 | 59 6f 72 6b 2c 20 49 6e | of New |York, In|
|00001750| 63 2e 0a 20 2a 20 34 35 | 35 20 46 69 72 73 74 20 |c.. * 45|5 First |
|00001760| 41 76 65 6e 75 65 0a 20 | 2a 20 4e 65 77 20 59 6f |Avenue. |* New Yo|
|00001770| 72 6b 2c 20 4e 59 20 31 | 30 30 31 36 0a 20 2a 2f |rk, NY 1|0016. */|
|00001780| 0a 0a 73 74 72 75 63 74 | 20 68 64 72 0a 7b 0a 09 |..struct| hdr.{..|
|00001790| 73 68 6f 72 74 09 09 68 | 5f 6d 61 67 69 63 3b 0a |short..h|_magic;.|
|000017a0| 09 73 68 6f 72 74 09 09 | 68 5f 64 65 76 3b 0a 09 |.short..|h_dev;..|
|000017b0| 75 6e 73 69 67 6e 65 64 | 20 73 68 6f 72 74 09 68 |unsigned| short.h|
|000017c0| 5f 69 6e 6f 3b 0a 09 75 | 6e 73 69 67 6e 65 64 20 |_ino;..u|nsigned |
|000017d0| 73 68 6f 72 74 09 68 5f | 6d 6f 64 65 3b 0a 09 75 |short.h_|mode;..u|
|000017e0| 6e 73 69 67 6e 65 64 20 | 73 68 6f 72 74 09 68 5f |nsigned |short.h_|
|000017f0| 75 69 64 3b 0a 09 75 6e | 73 69 67 6e 65 64 20 73 |uid;..un|signed s|
|00001800| 68 6f 72 74 09 68 5f 67 | 69 64 3b 0a 09 73 68 6f |hort.h_g|id;..sho|
|00001810| 72 74 09 09 68 5f 6e 6c | 69 6e 6b 3b 0a 09 73 68 |rt..h_nl|ink;..sh|
|00001820| 6f 72 74 09 09 68 5f 72 | 64 65 76 3b 0a 09 73 68 |ort..h_r|dev;..sh|
|00001830| 6f 72 74 09 09 68 5f 6d | 74 69 6d 65 5b 32 5d 3b |ort..h_m|time[2];|
|00001840| 0a 09 73 68 6f 72 74 09 | 09 68 5f 6e 61 6d 65 73 |..short.|.h_names|
|00001850| 69 7a 65 3b 0a 09 73 68 | 6f 72 74 09 09 68 5f 66 |ize;..sh|ort..h_f|
|00001860| 69 6c 65 73 69 7a 65 5b | 32 5d 3b 0a 7d 3b 0a 0a |ilesize[|2];.};..|
|00001870| 73 74 72 75 63 74 20 6c | 6f 6e 67 77 6f 72 64 0a |struct l|ongword.|
|00001880| 7b 0a 09 73 68 6f 72 74 | 20 77 6f 72 64 5b 32 5d |{..short| word[2]|
|00001890| 3b 0a 7d 3b 0a 0a 6d 61 | 69 6e 20 28 61 72 67 63 |;.};..ma|in (argc|
|000018a0| 2c 20 61 72 67 76 29 0a | 69 6e 74 20 61 72 67 63 |, argv).|int argc|
|000018b0| 3b 0a 63 68 61 72 20 2a | 61 72 67 76 20 5b 5d 3b |;.char *|argv [];|
|000018c0| 0a 7b 0a 09 73 74 72 75 | 63 74 20 68 64 72 20 68 |.{..stru|ct hdr h|
|000018d0| 65 61 64 65 72 3b 0a 09 | 69 6e 74 20 6e 2c 20 69 |eader;..|int n, i|
|000018e0| 2c 20 66 64 2c 20 6f 64 | 64 2c 20 73 69 7a 65 3b |, fd, od|d, size;|
|000018f0| 0a 09 73 74 72 75 63 74 | 20 6c 6f 6e 67 77 6f 72 |..struct| longwor|
|00001900| 64 20 2a 6c 77 70 3b 0a | 09 63 68 61 72 20 63 2c |d *lwp;.|.char c,|
|00001910| 20 2a 63 74 69 6d 65 28 | 29 2c 20 6e 61 6d 65 5b | *ctime(|), name[|
|00001920| 31 30 30 5d 3b 0a 09 73 | 68 6f 72 74 20 74 65 6d |100];..s|hort tem|
|00001930| 70 3b 0a 0a 09 2f 2a 0a | 09 20 2a 20 41 74 74 65 |p;.../*.|. * Atte|
|00001940| 6d 70 74 20 74 6f 20 6f | 70 65 6e 20 74 68 65 20 |mpt to o|pen the |
|00001950| 63 70 69 6f 20 61 72 63 | 68 69 76 65 20 66 69 6c |cpio arc|hive fil|
|00001960| 65 2e 0a 09 20 2a 2f 0a | 09 69 66 20 28 28 66 64 |e... */.|.if ((fd|
|00001970| 20 3d 20 6f 70 65 6e 20 | 28 61 72 67 76 5b 31 5d | = open |(argv[1]|
|00001980| 2c 20 30 29 29 20 3c 20 | 30 29 0a 09 7b 0a 09 09 |, 0)) < |0)..{...|
|00001990| 70 72 69 6e 74 66 20 28 | 22 63 61 6e 27 74 20 6f |printf (|"can't o|
|000019a0| 70 65 6e 20 66 69 6c 65 | 5c 6e 22 29 3b 0a 09 09 |pen file|\n");...|
|000019b0| 65 78 69 74 20 28 31 29 | 3b 0a 09 7d 0a 0a 09 77 |exit (1)|;..}...w|
|000019c0| 68 69 6c 65 20 28 31 29 | 0a 09 7b 0a 09 09 2f 2a |hile (1)|..{.../*|
|000019d0| 20 52 65 61 64 20 69 6e | 20 61 20 68 65 61 64 65 | Read in| a heade|
|000019e0| 72 20 2a 2f 0a 09 09 6e | 20 3d 20 72 65 61 64 20 |r */...n| = read |
|000019f0| 28 66 64 2c 20 26 68 65 | 61 64 65 72 2c 20 73 69 |(fd, &he|ader, si|
|00001a00| 7a 65 6f 66 20 28 68 65 | 61 64 65 72 29 29 3b 0a |zeof (he|ader));.|
|00001a10| 09 0a 09 09 2f 2a 0a 09 | 09 20 2a 20 54 68 65 20 |..../*..|. * The |
|00001a20| 68 69 67 68 20 61 6e 64 | 20 6c 6f 77 20 6f 72 64 |high and| low ord|
|00001a30| 65 72 20 77 6f 72 64 73 | 20 6f 66 20 74 68 65 20 |er words| of the |
|00001a40| 74 69 6d 65 20 61 72 65 | 0a 09 09 20 2a 20 69 6e |time are|... * in|
|00001a50| 20 74 68 65 20 77 72 6f | 6e 67 20 6f 72 64 65 72 | the wro|ng order|
|00001a60| 20 6f 6e 20 74 68 65 20 | 74 61 70 65 3b 20 73 77 | on the |tape; sw|
|00001a70| 61 70 20 74 68 65 6d 2e | 0a 09 09 20 2a 2f 0a 09 |ap them.|... */..|
|00001a80| 09 74 65 6d 70 20 3d 20 | 68 65 61 64 65 72 2e 68 |.temp = |header.h|
|00001a90| 5f 6d 74 69 6d 65 5b 30 | 5d 3b 0a 09 09 68 65 61 |_mtime[0|];...hea|
|00001aa0| 64 65 72 2e 68 5f 6d 74 | 69 6d 65 5b 30 5d 20 3d |der.h_mt|ime[0] =|
|00001ab0| 20 68 65 61 64 65 72 2e | 68 5f 6d 74 69 6d 65 5b | header.|h_mtime[|
|00001ac0| 31 5d 3b 0a 09 09 68 65 | 61 64 65 72 2e 68 5f 6d |1];...he|ader.h_m|
|00001ad0| 74 69 6d 65 5b 31 5d 20 | 3d 20 74 65 6d 70 3b 0a |time[1] |= temp;.|
|00001ae0| 0a 09 09 2f 2a 20 6c 69 | 6b 65 77 69 73 65 2c 20 |.../* li|kewise, |
|00001af0| 73 77 61 70 20 74 68 65 | 20 68 69 67 68 20 61 6e |swap the| high an|
|00001b00| 64 20 6c 6f 77 20 6f 72 | 64 65 72 20 73 69 7a 65 |d low or|der size|
|00001b10| 73 20 2a 2f 0a 09 09 6c | 77 70 20 3d 20 28 73 74 |s */...l|wp = (st|
|00001b20| 72 75 63 74 20 6c 6f 6e | 67 77 6f 72 64 20 2a 29 |ruct lon|gword *)|
|00001b30| 20 26 73 69 7a 65 3b 0a | 09 09 6c 77 70 2d 3e 77 | &size;.|..lwp->w|
|00001b40| 6f 72 64 5b 30 5d 20 3d | 20 68 65 61 64 65 72 2e |ord[0] =| header.|
|00001b50| 68 5f 66 69 6c 65 73 69 | 7a 65 5b 31 5d 3b 0a 09 |h_filesi|ze[1];..|
|00001b60| 09 6c 77 70 2d 3e 77 6f | 72 64 5b 31 5d 20 3d 20 |.lwp->wo|rd[1] = |
|00001b70| 68 65 61 64 65 72 2e 68 | 5f 66 69 6c 65 73 69 7a |header.h|_filesiz|
|00001b80| 65 5b 30 5d 3b 0a 0a 09 | 09 2f 2a 20 63 68 65 63 |e[0];...|./* chec|
|00001b90| 6b 20 66 6f 72 20 74 72 | 6f 75 62 6c 65 20 2a 2f |k for tr|ouble */|
|00001ba0| 0a 09 09 69 66 20 28 68 | 65 61 64 65 72 2e 68 5f |...if (h|eader.h_|
|00001bb0| 6d 61 67 69 63 20 21 3d | 20 30 37 30 37 30 37 29 |magic !=| 070707)|
|00001bc0| 0a 09 09 7b 0a 09 09 09 | 70 72 69 6e 74 66 20 28 |...{....|printf (|
|00001bd0| 22 6f 75 74 20 6f 66 20 | 73 79 6e 63 21 5c 6e 22 |"out of |sync!\n"|
|00001be0| 29 3b 0a 09 09 09 65 78 | 69 74 20 28 31 29 3b 0a |);....ex|it (1);.|
|00001bf0| 09 09 7d 0a 0a 09 09 2f | 2a 20 70 72 69 6e 74 20 |..}..../|* print |
|00001c00| 74 68 65 20 68 65 61 64 | 65 72 20 69 6e 66 6f 20 |the head|er info |
|00001c10| 2a 2f 0a 09 09 70 72 69 | 6e 74 66 20 28 22 25 35 |*/...pri|ntf ("%5|
|00001c20| 64 22 2c 20 68 65 61 64 | 65 72 2e 68 5f 69 6e 6f |d", head|er.h_ino|
|00001c30| 29 3b 0a 09 09 70 72 69 | 6e 74 66 20 28 22 25 39 |);...pri|ntf ("%9|
|00001c40| 23 6f 20 20 22 2c 20 68 | 65 61 64 65 72 2e 68 5f |#o ", h|eader.h_|
|00001c50| 6d 6f 64 65 29 3b 0a 09 | 09 70 72 69 6e 74 66 20 |mode);..|.printf |
|00001c60| 28 22 25 2e 32 34 73 22 | 2c 20 63 74 69 6d 65 20 |("%.24s"|, ctime |
|00001c70| 28 68 65 61 64 65 72 2e | 68 5f 6d 74 69 6d 65 29 |(header.|h_mtime)|
|00001c80| 29 3b 0a 09 09 70 72 69 | 6e 74 66 20 28 22 25 37 |);...pri|ntf ("%7|
|00001c90| 64 20 22 2c 20 73 69 7a | 65 29 3b 0a 0a 09 09 2f |d ", siz|e);..../|
|00001ca0| 2a 0a 09 09 20 2a 20 72 | 65 61 64 20 69 6e 20 74 |*... * r|ead in t|
|00001cb0| 68 65 20 66 69 6c 65 20 | 6e 61 6d 65 20 2d 2d 20 |he file |name -- |
|00001cc0| 6e 6f 74 69 63 65 20 74 | 68 61 74 20 69 66 20 74 |notice t|hat if t|
|00001cd0| 68 65 20 6e 61 6d 65 20 | 69 73 0a 09 09 20 2a 20 |he name |is... * |
|00001ce0| 61 6e 20 6f 64 64 20 6e | 75 6d 62 65 72 20 6f 66 |an odd n|umber of|
|00001cf0| 20 62 79 74 65 73 20 6c | 6f 6e 67 2c 20 69 74 20 | bytes l|ong, it |
|00001d00| 69 73 20 70 61 64 64 65 | 64 20 74 6f 20 62 65 20 |is padde|d to be |
|00001d10| 65 76 65 6e 2e 0a 09 09 | 20 2a 2f 0a 09 09 69 66 |even....| */...if|
|00001d20| 20 28 28 6e 20 3d 20 68 | 65 61 64 65 72 2e 68 5f | ((n = h|eader.h_|
|00001d30| 6e 61 6d 65 73 69 7a 65 | 29 20 25 20 32 20 21 3d |namesize|) % 2 !=|
|00001d40| 20 30 29 0a 09 09 09 6f | 64 64 20 3d 20 31 3b 0a | 0)....o|dd = 1;.|
|00001d50| 09 09 65 6c 73 65 0a 09 | 09 09 6f 64 64 20 3d 20 |..else..|..odd = |
|00001d60| 30 3b 0a 0a 09 09 69 20 | 3d 20 30 3b 0a 09 09 77 |0;....i |= 0;...w|
|00001d70| 68 69 6c 65 20 28 6e 2d | 2d 29 0a 09 09 7b 0a 09 |hile (n-|-)...{..|
|00001d80| 09 09 72 65 61 64 20 28 | 66 64 2c 20 26 63 2c 20 |..read (|fd, &c, |
|00001d90| 31 29 3b 0a 09 09 09 6e | 61 6d 65 20 5b 69 2b 2b |1);....n|ame [i++|
|00001da0| 5d 20 3d 20 63 3b 0a 09 | 09 7d 0a 09 09 70 72 69 |] = c;..|.}...pri|
|00001db0| 6e 74 66 20 28 22 25 73 | 5c 6e 22 2c 20 6e 61 6d |ntf ("%s|\n", nam|
|00001dc0| 65 29 3b 0a 09 09 69 66 | 20 28 6f 64 64 29 0a 09 |e);...if| (odd)..|
|00001dd0| 09 09 72 65 61 64 20 28 | 66 64 2c 20 26 63 2c 20 |..read (|fd, &c, |
|00001de0| 31 29 3b 0a 0a 09 09 2f | 2a 20 74 68 65 20 66 69 |1);..../|* the fi|
|00001df0| 6c 65 20 64 61 74 61 20 | 69 73 20 6c 69 6b 65 77 |le data |is likew|
|00001e00| 69 73 65 20 70 61 64 64 | 65 64 20 2a 2f 0a 09 09 |ise padd|ed */...|
|00001e10| 69 66 20 28 73 69 7a 65 | 20 25 20 32 20 21 3d 20 |if (size| % 2 != |
|00001e20| 30 29 0a 09 09 09 73 69 | 7a 65 2b 2b 3b 0a 0a 09 |0)....si|ze++;...|
|00001e30| 09 2f 2a 0a 09 09 20 2a | 20 77 65 20 64 6f 6e 27 |./*... *| we don'|
|00001e40| 74 20 61 63 74 75 61 6c | 6c 79 20 77 61 6e 74 20 |t actual|ly want |
|00001e50| 74 68 65 20 66 69 6c 65 | 2c 0a 09 09 20 2a 20 73 |the file|,... * s|
|00001e60| 6f 20 6a 75 73 74 20 73 | 6b 69 70 20 74 6f 20 74 |o just s|kip to t|
|00001e70| 68 65 20 6e 65 78 74 20 | 68 65 61 64 65 72 2e 0a |he next |header..|
|00001e80| 09 09 20 2a 2f 0a 09 09 | 6c 73 65 65 6b 20 28 66 |.. */...|lseek (f|
|00001e90| 64 2c 20 73 69 7a 65 2c | 20 31 29 3b 0a 09 7d 0a |d, size,| 1);..}.|
|00001ea0| 7d 0a 64 20 61 6e 79 20 | 70 72 6f 62 6c 65 6d 73 |}.d any |problems|
|00001eb0| 20 77 69 74 68 20 65 69 | 74 68 65 72 20 6f 66 0a | with ei|ther of.|
|00001ec0| 74 68 65 73 65 20 70 72 | 6f 67 72 61 6d 73 2c 20 |these pr|ograms, |
|00001ed0| 70 6c 65 61 73 65 20 66 | 65 65 6c 20 66 72 65 65 |please f|eel free|
|00001ee0| 20 74 6f 20 63 6f 6e 74 | 61 63 74 20 6d 65 2e 20 | to cont|act me. |
|00001ef0| 20 49 27 6c 6c 20 62 65 | 20 68 61 70 70 79 20 74 | I'll be| happy t|
|00001f00| 6f 20 68 65 6c 70 20 69 | 66 20 49 0a 63 61 6e 2c |o help i|f I.can,|
|00001f10| 20 62 75 74 20 70 6c 65 | 61 73 65 20 64 6f 6e 27 | but ple|ase don'|
|00001f20| 74 20 65 78 70 65 63 74 | 20 6d 65 20 74 6f 20 68 |t expect| me to h|
|00001f30| 61 76 65 20 74 68 65 20 | 75 70 64 61 74 65 64 20 |ave the |updated |
|00001f40| 76 65 72 73 69 6f 6e 73 | 20 72 65 61 64 79 20 6f |versions| ready o|
|00001f50| 6e 20 61 6e 79 0a 70 61 | 72 74 69 63 75 6c 61 72 |n any.pa|rticular|
|00001f60| 20 73 63 68 65 64 75 6c | 65 2e 0a 0a 61 6c 6c 65 | schedul|e...alle|
|00001f70| 67 72 61 21 70 68 72 69 | 21 72 6f 79 20 28 52 6f |gra!phri|!roy (Ro|
|00001f80| 79 20 53 6d 69 74 68 29 | 0a 53 79 73 74 65 6d 20 |y Smith)|.System |
|00001f90| 41 64 6d 69 6e 69 73 74 | 72 61 74 6f 72 2c 20 50 |Administ|rator, P|
|00001fa0| 75 62 6c 69 63 20 48 65 | 61 6c 74 68 20 52 65 73 |ublic He|alth Res|
|00001fb0| 65 61 72 63 68 20 49 6e | 73 74 69 74 75 74 65 0a |earch In|stitute.|
|00001fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002000| 63 70 69 6f 2f 63 70 69 | 6f 65 78 74 72 61 63 74 |cpio/cpi|oextract|
|00002010| 2e 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.c......|........|
|00002020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002060| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00002070| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00002080| 20 20 20 35 31 30 32 20 | 20 34 34 30 34 30 36 32 | 5102 | 4404062|
|00002090| 34 32 35 20 20 20 37 35 | 32 32 00 20 00 00 00 00 |425 75|22. ....|
|000020a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000021f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002200| 2f 2a 0a 20 2a 20 43 70 | 69 6f 65 78 74 72 61 63 |/*. * Cp|ioextrac|
|00002210| 74 2e 63 20 2d 2d 20 65 | 78 74 72 61 63 74 20 61 |t.c -- e|xtract a|
|00002220| 20 73 69 6e 67 6c 65 20 | 66 69 6c 65 20 66 72 6f | single |file fro|
|00002230| 6d 20 61 20 63 70 69 6f | 20 61 72 63 68 69 76 65 |m a cpio| archive|
|00002240| 0a 20 2a 20 77 72 69 74 | 74 65 6e 20 77 69 74 68 |. * writ|ten with|
|00002250| 20 62 69 6e 61 72 79 20 | 68 65 61 64 65 72 73 20 | binary |headers |
|00002260| 28 69 2e 65 2e 20 77 69 | 74 68 6f 75 74 20 74 68 |(i.e. wi|thout th|
|00002270| 65 20 2d 63 20 6f 70 74 | 69 6f 6e 29 0a 20 2a 0a |e -c opt|ion). *.|
|00002280| 20 2a 20 55 73 61 67 65 | 20 69 73 3a 20 63 70 69 | * Usage| is: cpi|
|00002290| 6f 65 78 74 72 61 63 74 | 20 63 70 69 6f 5f 61 72 |oextract| cpio_ar|
|000022a0| 63 68 69 76 65 5f 66 69 | 6c 65 20 61 72 63 68 69 |chive_fi|le archi|
|000022b0| 76 65 64 5f 66 69 6c 65 | 5f 6e 61 6d 65 0a 20 2a |ved_file|_name. *|
|000022c0| 0a 20 2a 20 57 72 69 74 | 74 65 6e 20 62 79 3a 0a |. * Writ|ten by:.|
|000022d0| 20 2a 20 52 6f 79 20 53 | 6d 69 74 68 20 3c 61 6c | * Roy S|mith <al|
|000022e0| 6c 65 67 72 61 21 70 68 | 72 69 21 72 6f 79 3e 0a |legra!ph|ri!roy>.|
|000022f0| 20 2a 20 54 68 65 20 50 | 75 62 6c 69 63 20 48 65 | * The P|ublic He|
|00002300| 61 6c 74 68 20 52 65 73 | 65 61 72 63 68 20 49 6e |alth Res|earch In|
|00002310| 73 74 69 74 75 74 65 0a | 20 2a 20 20 20 6f 66 20 |stitute.| * of |
|00002320| 74 68 65 20 43 69 74 79 | 20 6f 66 20 4e 65 77 20 |the City| of New |
|00002330| 59 6f 72 6b 2c 20 49 6e | 63 2e 0a 20 2a 20 34 35 |York, In|c.. * 45|
|00002340| 35 20 46 69 72 73 74 20 | 41 76 65 6e 75 65 2c 20 |5 First |Avenue, |
|00002350| 4e 65 77 20 59 6f 72 6b | 2c 20 4e 59 20 31 30 30 |New York|, NY 100|
|00002360| 31 36 0a 20 2a 2f 0a 0a | 73 74 72 75 63 74 20 68 |16. */..|struct h|
|00002370| 64 72 0a 7b 0a 09 73 68 | 6f 72 74 09 09 68 5f 6d |dr.{..sh|ort..h_m|
|00002380| 61 67 69 63 3b 0a 09 73 | 68 6f 72 74 09 09 68 5f |agic;..s|hort..h_|
|00002390| 64 65 76 3b 0a 09 75 6e | 73 69 67 6e 65 64 20 73 |dev;..un|signed s|
|000023a0| 68 6f 72 74 09 68 5f 69 | 6e 6f 3b 0a 09 75 6e 73 |hort.h_i|no;..uns|
|000023b0| 69 67 6e 65 64 20 73 68 | 6f 72 74 09 68 5f 6d 6f |igned sh|ort.h_mo|
|000023c0| 64 65 3b 0a 09 75 6e 73 | 69 67 6e 65 64 20 73 68 |de;..uns|igned sh|
|000023d0| 6f 72 74 09 68 5f 75 69 | 64 3b 0a 09 75 6e 73 69 |ort.h_ui|d;..unsi|
|000023e0| 67 6e 65 64 20 73 68 6f | 72 74 09 68 5f 67 69 64 |gned sho|rt.h_gid|
|000023f0| 3b 0a 09 73 68 6f 72 74 | 09 09 68 5f 6e 6c 69 6e |;..short|..h_nlin|
|00002400| 6b 3b 0a 09 73 68 6f 72 | 74 09 09 68 5f 72 64 65 |k;..shor|t..h_rde|
|00002410| 76 3b 0a 09 73 68 6f 72 | 74 09 09 68 5f 6d 74 69 |v;..shor|t..h_mti|
|00002420| 6d 65 5b 32 5d 3b 0a 09 | 73 68 6f 72 74 09 09 68 |me[2];..|short..h|
|00002430| 5f 6e 61 6d 65 73 69 7a | 65 3b 0a 09 73 68 6f 72 |_namesiz|e;..shor|
|00002440| 74 09 09 68 5f 66 69 6c | 65 73 69 7a 65 5b 32 5d |t..h_fil|esize[2]|
|00002450| 3b 0a 7d 3b 0a 0a 73 74 | 72 75 63 74 20 6c 6f 6e |;.};..st|ruct lon|
|00002460| 67 77 6f 72 64 0a 7b 0a | 09 73 68 6f 72 74 20 77 |gword.{.|.short w|
|00002470| 6f 72 64 5b 32 5d 3b 0a | 7d 3b 0a 0a 6d 61 69 6e |ord[2];.|};..main|
|00002480| 20 28 61 72 67 63 2c 20 | 61 72 67 76 29 0a 69 6e | (argc, |argv).in|
|00002490| 74 20 61 72 67 63 3b 0a | 63 68 61 72 20 2a 61 72 |t argc;.|char *ar|
|000024a0| 67 76 20 5b 5d 3b 0a 7b | 0a 09 73 74 72 75 63 74 |gv [];.{|..struct|
|000024b0| 20 68 64 72 20 68 65 61 | 64 65 72 3b 0a 09 69 6e | hdr hea|der;..in|
|000024c0| 74 20 6e 2c 20 69 2c 20 | 66 64 2c 20 6f 64 64 2c |t n, i, |fd, odd,|
|000024d0| 20 73 69 7a 65 3b 0a 09 | 73 74 72 75 63 74 20 6c | size;..|struct l|
|000024e0| 6f 6e 67 77 6f 72 64 20 | 2a 6c 77 70 3b 0a 09 63 |ongword |*lwp;..c|
|000024f0| 68 61 72 20 63 2c 20 2a | 63 74 69 6d 65 28 29 2c |har c, *|ctime(),|
|00002500| 20 6e 61 6d 65 5b 31 30 | 30 5d 3b 0a 09 73 68 6f | name[10|0];..sho|
|00002510| 72 74 20 74 65 6d 70 3b | 0a 0a 09 2f 2a 20 61 74 |rt temp;|.../* at|
|00002520| 74 65 6d 70 74 20 74 6f | 20 6f 70 65 6e 20 63 70 |tempt to| open cp|
|00002530| 69 6f 20 61 72 63 68 69 | 76 65 20 66 69 6c 65 20 |io archi|ve file |
|00002540| 2a 2f 0a 09 69 66 20 28 | 28 66 64 20 3d 20 6f 70 |*/..if (|(fd = op|
|00002550| 65 6e 20 28 61 72 67 76 | 5b 31 5d 2c 20 30 29 29 |en (argv|[1], 0))|
|00002560| 20 3c 20 30 29 0a 09 7b | 0a 09 09 70 72 69 6e 74 | < 0)..{|...print|
|00002570| 66 20 28 22 63 61 6e 27 | 74 20 6f 70 65 6e 20 66 |f ("can'|t open f|
|00002580| 69 6c 65 5c 6e 22 29 3b | 0a 09 09 65 78 69 74 20 |ile\n");|...exit |
|00002590| 28 31 29 3b 0a 09 7d 0a | 0a 09 77 68 69 6c 65 20 |(1);..}.|..while |
|000025a0| 28 31 29 0a 09 7b 0a 09 | 09 2f 2a 20 72 65 61 64 |(1)..{..|./* read|
|000025b0| 20 69 6e 20 61 20 68 65 | 61 64 65 72 20 2a 2f 09 | in a he|ader */.|
|000025c0| 09 0a 09 09 6e 20 3d 20 | 72 65 61 64 20 28 66 64 |....n = |read (fd|
|000025d0| 2c 20 26 68 65 61 64 65 | 72 2c 20 73 69 7a 65 6f |, &heade|r, sizeo|
|000025e0| 66 20 28 68 65 61 64 65 | 72 29 29 3b 0a 09 0a 09 |f (heade|r));....|
|000025f0| 09 2f 2a 20 74 61 70 65 | 20 68 61 73 20 68 69 67 |./* tape| has hig|
|00002600| 68 20 61 6e 64 20 6c 6f | 77 20 6f 72 64 65 72 20 |h and lo|w order |
|00002610| 74 69 6d 65 73 20 72 65 | 76 65 72 73 65 64 2c 20 |times re|versed, |
|00002620| 66 69 78 20 74 68 65 6d | 20 2a 2f 0a 09 09 74 65 |fix them| */...te|
|00002630| 6d 70 20 3d 20 68 65 61 | 64 65 72 2e 68 5f 6d 74 |mp = hea|der.h_mt|
|00002640| 69 6d 65 5b 30 5d 3b 0a | 09 09 68 65 61 64 65 72 |ime[0];.|..header|
|00002650| 2e 68 5f 6d 74 69 6d 65 | 5b 30 5d 20 3d 20 68 65 |.h_mtime|[0] = he|
|00002660| 61 64 65 72 2e 68 5f 6d | 74 69 6d 65 5b 31 5d 3b |ader.h_m|time[1];|
|00002670| 0a 09 09 68 65 61 64 65 | 72 2e 68 5f 6d 74 69 6d |...heade|r.h_mtim|
|00002680| 65 5b 31 5d 20 3d 20 74 | 65 6d 70 3b 0a 0a 09 09 |e[1] = t|emp;....|
|00002690| 2f 2a 20 6c 69 6b 65 77 | 69 73 65 2c 20 74 68 65 |/* likew|ise, the|
|000026a0| 20 66 69 6c 65 20 73 69 | 7a 65 20 2a 2f 0a 09 09 | file si|ze */...|
|000026b0| 6c 77 70 20 3d 20 28 73 | 74 72 75 63 74 20 6c 6f |lwp = (s|truct lo|
|000026c0| 6e 67 77 6f 72 64 20 2a | 29 20 26 73 69 7a 65 3b |ngword *|) &size;|
|000026d0| 0a 09 09 6c 77 70 2d 3e | 77 6f 72 64 5b 30 5d 20 |...lwp->|word[0] |
|000026e0| 3d 20 68 65 61 64 65 72 | 2e 68 5f 66 69 6c 65 73 |= header|.h_files|
|000026f0| 69 7a 65 5b 31 5d 3b 0a | 09 09 6c 77 70 2d 3e 77 |ize[1];.|..lwp->w|
|00002700| 6f 72 64 5b 31 5d 20 3d | 20 68 65 61 64 65 72 2e |ord[1] =| header.|
|00002710| 68 5f 66 69 6c 65 73 69 | 7a 65 5b 30 5d 3b 0a 0a |h_filesi|ze[0];..|
|00002720| 09 09 2f 2a 20 73 61 6e | 69 74 79 20 63 68 65 63 |../* san|ity chec|
|00002730| 6b 20 2a 2f 0a 09 09 69 | 66 20 28 68 65 61 64 65 |k */...i|f (heade|
|00002740| 72 2e 68 5f 6d 61 67 69 | 63 20 21 3d 20 30 37 30 |r.h_magi|c != 070|
|00002750| 37 30 37 29 0a 09 09 7b | 0a 09 09 09 70 72 69 6e |707)...{|....prin|
|00002760| 74 66 20 28 22 6f 75 74 | 20 6f 66 20 73 79 6e 63 |tf ("out| of sync|
|00002770| 21 5c 6e 22 29 3b 0a 09 | 09 09 65 78 69 74 20 28 |!\n");..|..exit (|
|00002780| 31 29 3b 0a 09 09 7d 0a | 0a 09 09 2f 2a 0a 09 09 |1);...}.|.../*...|
|00002790| 20 2a 20 69 66 20 74 68 | 65 20 66 69 6c 65 20 6e | * if th|e file n|
|000027a0| 61 6d 65 20 69 73 20 61 | 6e 20 6f 64 64 20 6e 75 |ame is a|n odd nu|
|000027b0| 6d 62 65 72 20 6f 66 20 | 63 68 61 72 61 63 74 65 |mber of |characte|
|000027c0| 72 73 2c 20 69 74 20 69 | 73 0a 09 09 20 2a 20 70 |rs, it i|s... * p|
|000027d0| 61 64 64 65 64 20 6f 6e | 20 74 68 65 20 74 61 70 |added on| the tap|
|000027e0| 65 20 74 6f 20 62 65 20 | 65 76 65 6e 3b 20 64 65 |e to be |even; de|
|000027f0| 61 6c 20 77 69 74 68 20 | 74 68 69 73 2e 0a 09 09 |al with |this....|
|00002800| 20 2a 2f 0a 09 09 69 66 | 20 28 28 6e 20 3d 20 68 | */...if| ((n = h|
|00002810| 65 61 64 65 72 2e 68 5f | 6e 61 6d 65 73 69 7a 65 |eader.h_|namesize|
|00002820| 29 20 25 20 32 20 21 3d | 20 30 29 0a 09 09 09 6f |) % 2 !=| 0)....o|
|00002830| 64 64 20 3d 20 31 3b 0a | 09 09 65 6c 73 65 0a 09 |dd = 1;.|..else..|
|00002840| 09 09 6f 64 64 20 3d 20 | 30 3b 0a 0a 09 09 2f 2a |..odd = |0;..../*|
|00002850| 20 72 65 61 64 20 74 68 | 65 20 66 69 6c 65 20 6e | read th|e file n|
|00002860| 61 6d 65 20 66 72 6f 6d | 20 74 68 65 20 61 72 63 |ame from| the arc|
|00002870| 68 69 76 65 20 2a 2f 0a | 09 09 69 20 3d 20 30 3b |hive */.|..i = 0;|
|00002880| 0a 09 09 77 68 69 6c 65 | 20 28 6e 2d 2d 29 0a 09 |...while| (n--)..|
|00002890| 09 7b 0a 09 09 09 72 65 | 61 64 20 28 66 64 2c 20 |.{....re|ad (fd, |
|000028a0| 26 63 2c 20 31 29 3b 0a | 09 09 09 6e 61 6d 65 20 |&c, 1);.|...name |
|000028b0| 5b 69 2b 2b 5d 20 3d 20 | 63 3b 0a 09 09 7d 0a 09 |[i++] = |c;...}..|
|000028c0| 09 69 66 20 28 6f 64 64 | 29 0a 09 09 09 72 65 61 |.if (odd|)....rea|
|000028d0| 64 20 28 66 64 2c 20 26 | 63 2c 20 31 29 3b 0a 0a |d (fd, &|c, 1);..|
|000028e0| 09 09 2f 2a 20 69 73 20 | 74 68 69 73 20 74 68 65 |../* is |this the|
|000028f0| 20 66 69 6c 65 20 77 65 | 20 77 61 6e 74 3f 20 2a | file we| want? *|
|00002900| 2f 0a 09 09 69 66 20 28 | 73 74 72 63 6d 70 20 28 |/...if (|strcmp (|
|00002910| 6e 61 6d 65 2c 20 61 72 | 67 76 5b 32 5d 29 20 3d |name, ar|gv[2]) =|
|00002920| 3d 20 30 29 0a 09 09 7b | 0a 09 09 09 63 6f 70 79 |= 0)...{|....copy|
|00002930| 6f 75 74 20 28 66 64 2c | 20 73 69 7a 65 29 3b 0a |out (fd,| size);.|
|00002940| 09 09 09 65 78 69 74 20 | 28 30 29 3b 0a 09 09 7d |...exit |(0);...}|
|00002950| 0a 09 09 65 6c 73 65 0a | 09 09 7b 0a 09 09 09 2f |...else.|..{..../|
|00002960| 2a 0a 09 09 09 20 2a 20 | 74 68 69 73 20 77 61 73 |*.... * |this was|
|00002970| 6e 27 74 20 74 68 65 20 | 72 69 67 68 74 20 66 69 |n't the |right fi|
|00002980| 6c 65 3b 20 73 6b 69 70 | 20 70 61 73 74 20 69 74 |le; skip| past it|
|00002990| 20 28 61 6e 64 20 6f 6e | 65 0a 09 09 09 20 2a 20 | (and on|e.... * |
|000029a0| 65 78 74 72 61 20 70 61 | 64 64 69 6e 67 20 62 79 |extra pa|dding by|
|000029b0| 74 65 20 69 66 20 74 68 | 65 20 66 69 6c 65 20 73 |te if th|e file s|
|000029c0| 69 7a 65 20 77 61 73 20 | 6f 64 64 29 2e 0a 09 09 |ize was |odd)....|
|000029d0| 09 20 2a 2f 0a 09 09 09 | 69 66 20 28 73 69 7a 65 |. */....|if (size|
|000029e0| 20 25 20 32 20 21 3d 20 | 30 29 0a 09 09 09 09 73 | % 2 != |0).....s|
|000029f0| 69 7a 65 2b 2b 3b 0a 0a | 09 09 09 6c 73 65 65 6b |ize++;..|...lseek|
|00002a00| 20 28 66 64 2c 20 73 69 | 7a 65 2c 20 31 29 3b 0a | (fd, si|ze, 1);.|
|00002a10| 09 09 7d 0a 09 7d 0a 7d | 0a 0a 2f 2a 0a 20 2a 20 |..}..}.}|../*. * |
|00002a20| 70 75 6c 6c 20 61 20 66 | 69 6c 65 20 6f 75 74 20 |pull a f|ile out |
|00002a30| 6f 66 20 74 68 65 20 61 | 72 63 68 69 76 65 2e 20 |of the a|rchive. |
|00002a40| 20 66 64 20 69 73 20 61 | 20 66 69 6c 65 20 64 65 | fd is a| file de|
|00002a50| 73 63 72 69 70 74 6f 72 | 20 66 6f 72 20 74 68 65 |scriptor| for the|
|00002a60| 0a 20 2a 20 63 70 69 6f | 20 61 72 63 68 69 76 65 |. * cpio| archive|
|00002a70| 2c 20 6e 20 69 73 20 74 | 68 65 20 73 69 7a 65 20 |, n is t|he size |
|00002a80| 6f 66 20 74 68 65 20 66 | 69 6c 65 20 77 65 20 61 |of the f|ile we a|
|00002a90| 72 65 20 73 75 70 70 6f | 73 65 64 20 74 6f 20 67 |re suppo|sed to g|
|00002aa0| 65 74 2e 0a 20 2a 20 74 | 68 65 20 66 69 6c 65 20 |et.. * t|he file |
|00002ab0| 69 73 20 6f 75 74 70 75 | 74 20 74 6f 20 73 74 61 |is outpu|t to sta|
|00002ac0| 6e 64 61 72 64 20 6f 75 | 74 70 75 74 2e 0a 20 2a |ndard ou|tput.. *|
|00002ad0| 2f 20 09 0a 63 6f 70 79 | 6f 75 74 20 28 66 64 2c |/ ..copy|out (fd,|
|00002ae0| 20 6e 29 0a 69 6e 74 20 | 66 64 2c 20 6e 3b 0a 7b | n).int |fd, n;.{|
|00002af0| 0a 09 69 6e 74 20 6e 6b | 3b 0a 09 63 68 61 72 20 |..int nk|;..char |
|00002b00| 62 75 66 5b 31 30 32 34 | 5d 3b 0a 0a 09 2f 2a 0a |buf[1024|];.../*.|
|00002b10| 09 20 2a 20 68 6f 77 20 | 6d 61 6e 79 20 66 75 6c |. * how |many ful|
|00002b20| 6c 20 6b 69 6c 6f 62 79 | 74 65 20 62 6c 6f 63 6b |l kiloby|te block|
|00002b30| 73 20 61 72 65 20 74 68 | 65 72 65 2c 0a 09 20 2a |s are th|ere,.. *|
|00002b40| 20 61 6e 64 20 68 6f 77 | 20 6d 61 6e 79 20 62 79 | and how| many by|
|00002b50| 74 65 73 20 6c 65 66 74 | 20 6f 76 65 72 3f 20 2a |tes left| over? *|
|00002b60| 2f 0a 09 20 2a 2f 0a 09 | 6e 6b 20 3d 20 6e 20 2f |/.. */..|nk = n /|
|00002b70| 20 31 30 32 34 3b 0a 09 | 6e 20 25 3d 20 31 30 32 | 1024;..|n %= 102|
|00002b80| 34 3b 0a 0a 09 2f 2a 20 | 67 65 74 20 61 6c 6c 20 |4;.../* |get all |
|00002b90| 74 68 65 20 77 68 6f 6c | 65 20 62 6c 6f 63 6b 73 |the whol|e blocks|
|00002ba0| 20 2a 2f 0a 09 77 68 69 | 6c 65 20 28 6e 6b 2d 2d | */..whi|le (nk--|
|00002bb0| 29 0a 09 7b 0a 09 09 72 | 65 61 64 20 28 66 64 2c |)..{...r|ead (fd,|
|00002bc0| 20 62 75 66 2c 20 31 30 | 32 34 29 3b 0a 09 09 77 | buf, 10|24);...w|
|00002bd0| 72 69 74 65 20 28 31 2c | 20 62 75 66 2c 20 31 30 |rite (1,| buf, 10|
|00002be0| 32 34 29 3b 0a 09 7d 0a | 09 2f 2a 20 61 6e 64 20 |24);..}.|./* and |
|00002bf0| 67 65 74 20 74 68 65 20 | 72 65 73 69 64 75 61 6c |get the |residual|
|00002c00| 20 66 72 61 63 74 69 6f | 6e 61 6c 20 6b 69 6c 6f | fractio|nal kilo|
|00002c10| 62 79 74 65 20 2a 2f 0a | 09 72 65 61 64 20 28 66 |byte */.|.read (f|
|00002c20| 64 2c 20 62 75 66 2c 20 | 6e 29 3b 0a 09 77 72 69 |d, buf, |n);..wri|
|00002c30| 74 65 20 28 31 2c 20 62 | 75 66 2c 20 6e 29 3b 0a |te (1, b|uf, n);.|
|00002c40| 7d 0a 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |}.......|........|
|00002c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003000| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003080| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003090| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003200| 20 66 65 61 74 75 72 65 | 73 20 61 72 65 20 74 68 | feature|s are th|
|00003210| 65 20 27 2d 63 27 20 61 | 6e 64 20 27 2d 64 27 20 |e '-c' a|nd '-d' |
|00003220| 66 6c 61 67 73 2c 20 61 | 6e 64 0a 74 68 65 6e 20 |flags, a|nd.then |
|00003230| 70 61 74 74 65 72 6e 20 | 6d 61 74 63 68 69 6e 67 |pattern |matching|
|00003240| 20 66 6f 72 20 66 69 6c | 65 20 6e 61 6d 65 73 2e | for fil|e names.|
|00003250| 20 20 49 66 20 49 20 65 | 76 65 72 20 67 65 74 20 | If I e|ver get |
|00003260| 61 72 6f 75 6e 64 20 74 | 6f 20 64 6f 69 6e 67 20 |around t|o doing |
|00003270| 74 68 6f 73 65 2c 0a 49 | 27 6c 6c 20 70 6f 73 74 |those,.I|'ll post|
|00003280| 20 74 68 65 20 75 70 64 | 61 74 65 64 20 76 65 72 | the upd|ated ver|
|00003290| 73 69 6f 6e 73 2e 20 20 | 49 66 20 79 6f 75 20 66 |sions. |If you f|
|000032a0| 69 6e 64 20 61 6e 79 20 | 70 72 6f 62 6c 65 6d 73 |ind any |problems|
|000032b0| 20 77 69 74 68 20 65 69 | 74 68 65 72 20 6f 66 0a | with ei|ther of.|
|000032c0| 74 68 65 73 65 20 70 72 | 6f 67 72 61 6d 73 2c 20 |these pr|ograms, |
|000032d0| 70 6c 65 61 73 65 20 66 | 65 65 6c 20 66 72 65 65 |please f|eel free|
|000032e0| 20 74 6f 20 63 6f 6e 74 | 61 63 74 20 6d 65 2e 20 | to cont|act me. |
|000032f0| 20 49 27 6c 6c 20 62 65 | 20 68 61 70 70 79 20 74 | I'll be| happy t|
|00003300| 6f 20 68 65 6c 70 20 69 | 66 20 49 0a 63 61 6e 2c |o help i|f I.can,|
|00003310| 20 62 75 74 20 70 6c 65 | 61 73 65 20 64 6f 6e 27 | but ple|ase don'|
|00003320| 74 20 65 78 70 65 63 74 | 20 6d 65 20 74 6f 20 68 |t expect| me to h|
|00003330| 61 76 65 20 74 68 65 20 | 75 70 64 61 74 65 64 20 |ave the |updated |
|00003340| 76 65 72 73 69 6f 6e 73 | 20 72 65 61 64 79 20 6f |versions| ready o|
|00003350| 6e 20 61 6e 79 0a 70 61 | 72 74 69 63 75 6c 61 72 |n any.pa|rticular|
|00003360| 20 73 63 68 65 64 75 6c | 65 2e 0a 0a 61 6c 6c 65 | schedul|e...alle|
|00003370| 67 72 61 21 70 68 72 69 | 21 72 6f 79 20 28 52 6f |gra!phri|!roy (Ro|
|00003380| 79 20 53 6d 69 74 68 29 | 0a 53 79 73 74 65 6d 20 |y Smith)|.System |
|00003390| 41 64 6d 69 6e 69 73 74 | 72 61 74 6f 72 2c 20 50 |Administ|rator, P|
|000033a0| 75 62 6c 69 63 20 48 65 | 61 6c 74 68 20 52 65 73 |ublic He|alth Res|
|000033b0| 65 61 72 63 68 20 49 6e | 73 74 69 74 75 74 65 0a |earch In|stitute.|
|000033c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003400| 63 70 69 6f 2f 63 70 69 | 6f 6c 69 73 74 2e 63 00 |cpio/cpi|olist.c.|
|00003410| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003460| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00003470| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00003480| 20 20 20 34 32 34 32 20 | 20 34 34 30 34 30 36 32 | 4242 | 4404062|
|00003490| 34 32 33 20 20 20 37 30 | 32 35 00 20 00 00 00 00 |423 70|25. ....|
|000034a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003500| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003600| 2f 2a 0a 20 2a 20 43 70 | 69 6f 6c 69 73 74 2e 63 |/*. * Cp|iolist.c|
|00003610| 20 2d 2d 20 6c 69 73 74 | 20 61 20 63 70 69 6f 20 | -- list| a cpio |
|00003620| 74 61 70 65 20 77 72 69 | 74 74 65 6e 20 77 69 74 |tape wri|tten wit|
|00003630| 68 20 62 69 6e 61 72 79 | 20 68 65 61 64 65 72 73 |h binary| headers|
|00003640| 0a 20 2a 20 28 69 2e 65 | 2e 20 77 72 69 74 74 65 |. * (i.e|. writte|
|00003650| 6e 20 77 69 74 68 6f 75 | 74 20 74 68 65 20 2d 63 |n withou|t the -c|
|00003660| 20 6f 70 74 69 6f 6e 29 | 2e 20 20 55 73 61 67 65 | option)|. Usage|
|00003670| 20 69 73 20 22 63 70 69 | 6f 6c 69 73 74 20 66 69 | is "cpi|olist fi|
|00003680| 6c 65 22 0a 20 2a 20 77 | 68 65 72 65 20 27 66 69 |le". * w|here 'fi|
|00003690| 6c 65 27 20 69 73 20 74 | 68 65 20 63 70 69 6f 20 |le' is t|he cpio |
|000036a0| 61 72 63 68 69 76 65 20 | 28 70 72 6f 62 61 62 6c |archive |(probabl|
|000036b0| 79 20 2f 64 65 76 2f 72 | 6d 74 31 32 29 2e 0a 20 |y /dev/r|mt12).. |
|000036c0| 2a 0a 20 2a 20 57 72 69 | 74 65 6e 2c 20 70 72 6f |*. * Wri|ten, pro|
|000036d0| 64 75 63 65 64 2c 20 61 | 6e 64 20 64 69 72 65 63 |duced, a|nd direc|
|000036e0| 74 65 64 20 62 79 3a 0a | 20 2a 20 52 6f 79 20 53 |ted by:.| * Roy S|
|000036f0| 6d 69 74 68 20 3c 61 6c | 6c 65 67 72 61 21 70 68 |mith <al|legra!ph|
|00003700| 72 69 21 72 6f 79 3e 0a | 20 2a 20 54 68 65 20 50 |ri!roy>.| * The P|
|00003710| 75 62 6c 69 63 20 48 65 | 61 6c 74 68 20 52 65 73 |ublic He|alth Res|
|00003720| 65 61 72 63 68 20 49 6e | 73 74 69 74 75 74 65 0a |earch In|stitute.|
|00003730| 20 2a 20 20 20 6f 66 20 | 74 68 65 20 43 69 74 79 | * of |the City|
|00003740| 20 6f 66 20 4e 65 77 20 | 59 6f 72 6b 2c 20 49 6e | of New |York, In|
|00003750| 63 2e 0a 20 2a 20 34 35 | 35 20 46 69 72 73 74 20 |c.. * 45|5 First |
|00003760| 41 76 65 6e 75 65 0a 20 | 2a 20 4e 65 77 20 59 6f |Avenue. |* New Yo|
|00003770| 72 6b 2c 20 4e 59 20 31 | 30 30 31 36 0a 20 2a 2f |rk, NY 1|0016. */|
|00003780| 0a 0a 73 74 72 75 63 74 | 20 68 64 72 0a 7b 0a 09 |..struct| hdr.{..|
|00003790| 73 68 6f 72 74 09 09 68 | 5f 6d 61 67 69 63 3b 0a |short..h|_magic;.|
|000037a0| 09 73 68 6f 72 74 09 09 | 68 5f 64 65 76 3b 0a 09 |.short..|h_dev;..|
|000037b0| 75 6e 73 69 67 6e 65 64 | 20 73 68 6f 72 74 09 68 |unsigned| short.h|
|000037c0| 5f 69 6e 6f 3b 0a 09 75 | 6e 73 69 67 6e 65 64 20 |_ino;..u|nsigned |
|000037d0| 73 68 6f 72 74 09 68 5f | 6d 6f 64 65 3b 0a 09 75 |short.h_|mode;..u|
|000037e0| 6e 73 69 67 6e 65 64 20 | 73 68 6f 72 74 09 68 5f |nsigned |short.h_|
|000037f0| 75 69 64 3b 0a 09 75 6e | 73 69 67 6e 65 64 20 73 |uid;..un|signed s|
|00003800| 68 6f 72 74 09 68 5f 67 | 69 64 3b 0a 09 73 68 6f |hort.h_g|id;..sho|
|00003810| 72 74 09 09 68 5f 6e 6c | 69 6e 6b 3b 0a 09 73 68 |rt..h_nl|ink;..sh|
|00003820| 6f 72 74 09 09 68 5f 72 | 64 65 76 3b 0a 09 73 68 |ort..h_r|dev;..sh|
|00003830| 6f 72 74 09 09 68 5f 6d | 74 69 6d 65 5b 32 5d 3b |ort..h_m|time[2];|
|00003840| 0a 09 73 68 6f 72 74 09 | 09 68 5f 6e 61 6d 65 73 |..short.|.h_names|
|00003850| 69 7a 65 3b 0a 09 73 68 | 6f 72 74 09 09 68 5f 66 |ize;..sh|ort..h_f|
|00003860| 69 6c 65 73 69 7a 65 5b | 32 5d 3b 0a 7d 3b 0a 0a |ilesize[|2];.};..|
|00003870| 73 74 72 75 63 74 20 6c | 6f 6e 67 77 6f 72 64 0a |struct l|ongword.|
|00003880| 7b 0a 09 73 68 6f 72 74 | 20 77 6f 72 64 5b 32 5d |{..short| word[2]|
|00003890| 3b 0a 7d 3b 0a 0a 6d 61 | 69 6e 20 28 61 72 67 63 |;.};..ma|in (argc|
|000038a0| 2c 20 61 72 67 76 29 0a | 69 6e 74 20 61 72 67 63 |, argv).|int argc|
|000038b0| 3b 0a 63 68 61 72 20 2a | 61 72 67 76 20 5b 5d 3b |;.char *|argv [];|
|000038c0| 0a 7b 0a 09 73 74 72 75 | 63 74 20 68 64 72 20 68 |.{..stru|ct hdr h|
|000038d0| 65 61 64 65 72 3b 0a 09 | 69 6e 74 20 6e 2c 20 69 |eader;..|int n, i|
|000038e0| 2c 20 66 64 2c 20 6f 64 | 64 2c 20 73 69 7a 65 3b |, fd, od|d, size;|
|000038f0| 0a 09 73 74 72 75 63 74 | 20 6c 6f 6e 67 77 6f 72 |..struct| longwor|
|00003900| 64 20 2a 6c 77 70 3b 0a | 09 63 68 61 72 20 63 2c |d *lwp;.|.char c,|
|00003910| 20 2a 63 74 69 6d 65 28 | 29 2c 20 6e 61 6d 65 5b | *ctime(|), name[|
|00003920| 31 30 30 5d 3b 0a 09 73 | 68 6f 72 74 20 74 65 6d |100];..s|hort tem|
|00003930| 70 3b 0a 0a 09 2f 2a 0a | 09 20 2a 20 41 74 74 65 |p;.../*.|. * Atte|
|00003940| 6d 70 74 20 74 6f 20 6f | 70 65 6e 20 74 68 65 20 |mpt to o|pen the |
|00003950| 63 70 69 6f 20 61 72 63 | 68 69 76 65 20 66 69 6c |cpio arc|hive fil|
|00003960| 65 2e 0a 09 20 2a 2f 0a | 09 69 66 20 28 28 66 64 |e... */.|.if ((fd|
|00003970| 20 3d 20 6f 70 65 6e 20 | 28 61 72 67 76 5b 31 5d | = open |(argv[1]|
|00003980| 2c 20 30 29 29 20 3c 20 | 30 29 0a 09 7b 0a 09 09 |, 0)) < |0)..{...|
|00003990| 70 72 69 6e 74 66 20 28 | 22 63 61 6e 27 74 20 6f |printf (|"can't o|
|000039a0| 70 65 6e 20 66 69 6c 65 | 5c 6e 22 29 3b 0a 09 09 |pen file|\n");...|
|000039b0| 65 78 69 74 20 28 31 29 | 3b 0a 09 7d 0a 0a 09 77 |exit (1)|;..}...w|
|000039c0| 68 69 6c 65 20 28 31 29 | 0a 09 7b 0a 09 09 2f 2a |hile (1)|..{.../*|
|000039d0| 20 52 65 61 64 20 69 6e | 20 61 20 68 65 61 64 65 | Read in| a heade|
|000039e0| 72 20 2a 2f 0a 09 09 6e | 20 3d 20 72 65 61 64 20 |r */...n| = read |
|000039f0| 28 66 64 2c 20 26 68 65 | 61 64 65 72 2c 20 73 69 |(fd, &he|ader, si|
|00003a00| 7a 65 6f 66 20 28 68 65 | 61 64 65 72 29 29 3b 0a |zeof (he|ader));.|
|00003a10| 09 0a 09 09 2f 2a 0a 09 | 09 20 2a 20 54 68 65 20 |..../*..|. * The |
|00003a20| 68 69 67 68 20 61 6e 64 | 20 6c 6f 77 20 6f 72 64 |high and| low ord|
|00003a30| 65 72 20 77 6f 72 64 73 | 20 6f 66 20 74 68 65 20 |er words| of the |
|00003a40| 74 69 6d 65 20 61 72 65 | 0a 09 09 20 2a 20 69 6e |time are|... * in|
|00003a50| 20 74 68 65 20 77 72 6f | 6e 67 20 6f 72 64 65 72 | the wro|ng order|
|00003a60| 20 6f 6e 20 74 68 65 20 | 74 61 70 65 3b 20 73 77 | on the |tape; sw|
|00003a70| 61 70 20 74 68 65 6d 2e | 0a 09 09 20 2a 2f 0a 09 |ap them.|... */..|
|00003a80| 09 74 65 6d 70 20 3d 20 | 68 65 61 64 65 72 2e 68 |.temp = |header.h|
|00003a90| 5f 6d 74 69 6d 65 5b 30 | 5d 3b 0a 09 09 68 65 61 |_mtime[0|];...hea|
|00003aa0| 64 65 72 2e 68 5f 6d 74 | 69 6d 65 5b 30 5d 20 3d |der.h_mt|ime[0] =|
|00003ab0| 20 68 65 61 64 65 72 2e | 68 5f 6d 74 69 6d 65 5b | header.|h_mtime[|
|00003ac0| 31 5d 3b 0a 09 09 68 65 | 61 64 65 72 2e 68 5f 6d |1];...he|ader.h_m|
|00003ad0| 74 69 6d 65 5b 31 5d 20 | 3d 20 74 65 6d 70 3b 0a |time[1] |= temp;.|
|00003ae0| 0a 09 09 2f 2a 20 6c 69 | 6b 65 77 69 73 65 2c 20 |.../* li|kewise, |
|00003af0| 73 77 61 70 20 74 68 65 | 20 68 69 67 68 20 61 6e |swap the| high an|
|00003b00| 64 20 6c 6f 77 20 6f 72 | 64 65 72 20 73 69 7a 65 |d low or|der size|
|00003b10| 73 20 2a 2f 0a 09 09 6c | 77 70 20 3d 20 28 73 74 |s */...l|wp = (st|
|00003b20| 72 75 63 74 20 6c 6f 6e | 67 77 6f 72 64 20 2a 29 |ruct lon|gword *)|
|00003b30| 20 26 73 69 7a 65 3b 0a | 09 09 6c 77 70 2d 3e 77 | &size;.|..lwp->w|
|00003b40| 6f 72 64 5b 30 5d 20 3d | 20 68 65 61 64 65 72 2e |ord[0] =| header.|
|00003b50| 68 5f 66 69 6c 65 73 69 | 7a 65 5b 31 5d 3b 0a 09 |h_filesi|ze[1];..|
|00003b60| 09 6c 77 70 2d 3e 77 6f | 72 64 5b 31 5d 20 3d 20 |.lwp->wo|rd[1] = |
|00003b70| 68 65 61 64 65 72 2e 68 | 5f 66 69 6c 65 73 69 7a |header.h|_filesiz|
|00003b80| 65 5b 30 5d 3b 0a 0a 09 | 09 2f 2a 20 63 68 65 63 |e[0];...|./* chec|
|00003b90| 6b 20 66 6f 72 20 74 72 | 6f 75 62 6c 65 20 2a 2f |k for tr|ouble */|
|00003ba0| 0a 09 09 69 66 20 28 68 | 65 61 64 65 72 2e 68 5f |...if (h|eader.h_|
|00003bb0| 6d 61 67 69 63 20 21 3d | 20 30 37 30 37 30 37 29 |magic !=| 070707)|
|00003bc0| 0a 09 09 7b 0a 09 09 09 | 70 72 69 6e 74 66 20 28 |...{....|printf (|
|00003bd0| 22 6f 75 74 20 6f 66 20 | 73 79 6e 63 21 5c 6e 22 |"out of |sync!\n"|
|00003be0| 29 3b 0a 09 09 09 65 78 | 69 74 20 28 31 29 3b 0a |);....ex|it (1);.|
|00003bf0| 09 09 7d 0a 0a 09 09 2f | 2a 20 70 72 69 6e 74 20 |..}..../|* print |
|00003c00| 74 68 65 20 68 65 61 64 | 65 72 20 69 6e 66 6f 20 |the head|er info |
|00003c10| 2a 2f 0a 09 09 70 72 69 | 6e 74 66 20 28 22 25 35 |*/...pri|ntf ("%5|
|00003c20| 64 22 2c 20 68 65 61 64 | 65 72 2e 68 5f 69 6e 6f |d", head|er.h_ino|
|00003c30| 29 3b 0a 09 09 70 72 69 | 6e 74 66 20 28 22 25 39 |);...pri|ntf ("%9|
|00003c40| 23 6f 20 20 22 2c 20 68 | 65 61 64 65 72 2e 68 5f |#o ", h|eader.h_|
|00003c50| 6d 6f 64 65 29 3b 0a 09 | 09 70 72 69 6e 74 66 20 |mode);..|.printf |
|00003c60| 28 22 25 2e 32 34 73 22 | 2c 20 63 74 69 6d 65 20 |("%.24s"|, ctime |
|00003c70| 28 68 65 61 64 65 72 2e | 68 5f 6d 74 69 6d 65 29 |(header.|h_mtime)|
|00003c80| 29 3b 0a 09 09 70 72 69 | 6e 74 66 20 28 22 25 37 |);...pri|ntf ("%7|
|00003c90| 64 20 22 2c 20 73 69 7a | 65 29 3b 0a 0a 09 09 2f |d ", siz|e);..../|
|00003ca0| 2a 0a 09 09 20 2a 20 72 | 65 61 64 20 69 6e 20 74 |*... * r|ead in t|
|00003cb0| 68 65 20 66 69 6c 65 20 | 6e 61 6d 65 20 2d 2d 20 |he file |name -- |
|00003cc0| 6e 6f 74 69 63 65 20 74 | 68 61 74 20 69 66 20 74 |notice t|hat if t|
|00003cd0| 68 65 20 6e 61 6d 65 20 | 69 73 0a 09 09 20 2a 20 |he name |is... * |
|00003ce0| 61 6e 20 6f 64 64 20 6e | 75 6d 62 65 72 20 6f 66 |an odd n|umber of|
|00003cf0| 20 62 79 74 65 73 20 6c | 6f 6e 67 2c 20 69 74 20 | bytes l|ong, it |
|00003d00| 69 73 20 70 61 64 64 65 | 64 20 74 6f 20 62 65 20 |is padde|d to be |
|00003d10| 65 76 65 6e 2e 0a 09 09 | 20 2a 2f 0a 09 09 69 66 |even....| */...if|
|00003d20| 20 28 28 6e 20 3d 20 68 | 65 61 64 65 72 2e 68 5f | ((n = h|eader.h_|
|00003d30| 6e 61 6d 65 73 69 7a 65 | 29 20 25 20 32 20 21 3d |namesize|) % 2 !=|
|00003d40| 20 30 29 0a 09 09 09 6f | 64 64 20 3d 20 31 3b 0a | 0)....o|dd = 1;.|
|00003d50| 09 09 65 6c 73 65 0a 09 | 09 09 6f 64 64 20 3d 20 |..else..|..odd = |
|00003d60| 30 3b 0a 0a 09 09 69 20 | 3d 20 30 3b 0a 09 09 77 |0;....i |= 0;...w|
|00003d70| 68 69 6c 65 20 28 6e 2d | 2d 29 0a 09 09 7b 0a 09 |hile (n-|-)...{..|
|00003d80| 09 09 72 65 61 64 20 28 | 66 64 2c 20 26 63 2c 20 |..read (|fd, &c, |
|00003d90| 31 29 3b 0a 09 09 09 6e | 61 6d 65 20 5b 69 2b 2b |1);....n|ame [i++|
|00003da0| 5d 20 3d 20 63 3b 0a 09 | 09 7d 0a 09 09 70 72 69 |] = c;..|.}...pri|
|00003db0| 6e 74 66 20 28 22 25 73 | 5c 6e 22 2c 20 6e 61 6d |ntf ("%s|\n", nam|
|00003dc0| 65 29 3b 0a 09 09 69 66 | 20 28 6f 64 64 29 0a 09 |e);...if| (odd)..|
|00003dd0| 09 09 72 65 61 64 20 28 | 66 64 2c 20 26 63 2c 20 |..read (|fd, &c, |
|00003de0| 31 29 3b 0a 0a 09 09 2f | 2a 20 74 68 65 20 66 69 |1);..../|* the fi|
|00003df0| 6c 65 20 64 61 74 61 20 | 69 73 20 6c 69 6b 65 77 |le data |is likew|
|00003e00| 69 73 65 20 70 61 64 64 | 65 64 20 2a 2f 0a 09 09 |ise padd|ed */...|
|00003e10| 69 66 20 28 73 69 7a 65 | 20 25 20 32 20 21 3d 20 |if (size| % 2 != |
|00003e20| 30 29 0a 09 09 09 73 69 | 7a 65 2b 2b 3b 0a 0a 09 |0)....si|ze++;...|
|00003e30| 09 2f 2a 0a 09 09 20 2a | 20 77 65 20 64 6f 6e 27 |./*... *| we don'|
|00003e40| 74 20 61 63 74 75 61 6c | 6c 79 20 77 61 6e 74 20 |t actual|ly want |
|00003e50| 74 68 65 20 66 69 6c 65 | 2c 0a 09 09 20 2a 20 73 |the file|,... * s|
|00003e60| 6f 20 6a 75 73 74 20 73 | 6b 69 70 20 74 6f 20 74 |o just s|kip to t|
|00003e70| 68 65 20 6e 65 78 74 20 | 68 65 61 64 65 72 2e 0a |he next |header..|
|00003e80| 09 09 20 2a 2f 0a 09 09 | 6c 73 65 65 6b 20 28 66 |.. */...|lseek (f|
|00003e90| 64 2c 20 73 69 7a 65 2c | 20 31 29 3b 0a 09 7d 0a |d, size,| 1);..}.|
|00003ea0| 7d 0a 64 20 61 6e 79 20 | 70 72 6f 62 6c 65 6d 73 |}.d any |problems|
|00003eb0| 20 77 69 74 68 20 65 69 | 74 68 65 72 20 6f 66 0a | with ei|ther of.|
|00003ec0| 74 68 65 73 65 20 70 72 | 6f 67 72 61 6d 73 2c 20 |these pr|ograms, |
|00003ed0| 70 6c 65 61 73 65 20 66 | 65 65 6c 20 66 72 65 65 |please f|eel free|
|00003ee0| 20 74 6f 20 63 6f 6e 74 | 61 63 74 20 6d 65 2e 20 | to cont|act me. |
|00003ef0| 20 49 27 6c 6c 20 62 65 | 20 68 61 70 70 79 20 74 | I'll be| happy t|
|00003f00| 6f 20 68 65 6c 70 20 69 | 66 20 49 0a 63 61 6e 2c |o help i|f I.can,|
|00003f10| 20 62 75 74 20 70 6c 65 | 61 73 65 20 64 6f 6e 27 | but ple|ase don'|
|00003f20| 74 20 65 78 70 65 63 74 | 20 6d 65 20 74 6f 20 68 |t expect| me to h|
|00003f30| 61 76 65 20 74 68 65 20 | 75 70 64 61 74 65 64 20 |ave the |updated |
|00003f40| 76 65 72 73 69 6f 6e 73 | 20 72 65 61 64 79 20 6f |versions| ready o|
|00003f50| 6e 20 61 6e 79 0a 70 61 | 72 74 69 63 75 6c 61 72 |n any.pa|rticular|
|00003f60| 20 73 63 68 65 64 75 6c | 65 2e 0a 0a 61 6c 6c 65 | schedul|e...alle|
|00003f70| 67 72 61 21 70 68 72 69 | 21 72 6f 79 20 28 52 6f |gra!phri|!roy (Ro|
|00003f80| 79 20 53 6d 69 74 68 29 | 0a 53 79 73 74 65 6d 20 |y Smith)|.System |
|00003f90| 41 64 6d 69 6e 69 73 74 | 72 61 74 6f 72 2c 20 50 |Administ|rator, P|
|00003fa0| 75 62 6c 69 63 20 48 65 | 61 6c 74 68 20 52 65 73 |ublic He|alth Res|
|00003fb0| 65 61 72 63 68 20 49 6e | 73 74 69 74 75 74 65 0a |earch In|stitute.|
|00003fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+