home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news or mail text
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| C source, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/rfc822
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 74 61 | 6c 63 6f 74 74 21 63 62 |From: ta|lcott!cb|
|00000010| 70 61 76 6f 2e 63 62 6f | 73 67 64 2e 41 54 54 3a |pavo.cbo|sgd.ATT:|
|00000020| 75 6c 79 73 73 65 73 21 | 6d 61 72 6b 20 28 4d 61 |ulysses!|mark (Ma|
|00000030| 72 6b 20 48 6f 72 74 6f | 6e 29 0a 53 75 62 6a 65 |rk Horto|n).Subje|
|00000040| 63 74 3a 20 70 6f 72 74 | 61 62 6c 65 20 61 72 3a |ct: port|able ar:|
|00000050| 20 73 75 67 67 65 73 74 | 65 64 20 72 65 70 6c 61 | suggest|ed repla|
|00000060| 63 65 6d 65 6e 74 20 66 | 6f 72 20 73 68 61 72 0a |cement f|or shar.|
|00000070| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 6d 6f 64 2e |Newsgrou|ps: mod.|
|00000080| 73 6f 75 72 63 65 73 0a | 41 70 70 72 6f 76 65 64 |sources.|Approved|
|00000090| 3a 20 6a 70 6e 40 70 61 | 6e 64 61 2e 55 55 43 50 |: jpn@pa|nda.UUCP|
|000000a0| 0a 0a 4d 6f 64 2e 73 6f | 75 72 63 65 73 3a 20 20 |..Mod.so|urces: |
|000000b0| 56 6f 6c 75 6d 65 20 34 | 2c 20 49 73 73 75 65 20 |Volume 4|, Issue |
|000000c0| 38 31 0a 53 75 62 6d 69 | 74 74 65 64 20 62 79 3a |81.Submi|tted by:|
|000000d0| 20 74 61 6c 63 6f 74 74 | 21 63 62 70 61 76 6f 2e | talcott|!cbpavo.|
|000000e0| 63 62 6f 73 67 64 2e 41 | 54 54 3a 75 6c 79 73 73 |cbosgd.A|TT:ulyss|
|000000f0| 65 73 21 6d 61 72 6b 20 | 28 4d 61 72 6b 20 48 6f |es!mark |(Mark Ho|
|00000100| 72 74 6f 6e 29 0a 0a 5b | 0a 20 20 54 68 69 73 20 |rton)..[|. This |
|00000110| 69 73 20 6f 6e 65 20 6f | 66 20 74 77 6f 20 73 75 |is one o|f two su|
|00000120| 62 6d 69 73 73 69 6f 6e | 73 20 6f 66 20 70 72 6f |bmission|s of pro|
|00000130| 67 72 61 6d 73 20 74 68 | 61 74 20 70 72 6f 76 69 |grams th|at provi|
|00000140| 64 65 20 61 6c 74 65 72 | 6e 61 74 69 76 65 73 20 |de alter|natives |
|00000150| 74 6f 0a 20 20 22 73 68 | 61 72 22 20 61 73 20 61 |to. "sh|ar" as a|
|00000160| 20 73 6f 75 72 63 65 20 | 61 72 63 68 69 76 65 20 | source |archive |
|00000170| 66 6f 72 6d 61 74 2e 20 | 20 54 68 69 73 20 64 6f |format. | This do|
|00000180| 65 73 20 6e 6f 74 20 69 | 6d 70 6c 79 20 6d 79 20 |es not i|mply my |
|00000190| 73 75 70 70 6f 72 74 20 | 6f 66 0a 20 20 6f 6e 65 |support |of. one|
|000001a0| 20 66 6f 72 6d 61 74 20 | 6f 76 65 72 20 61 6e 6f | format |over ano|
|000001b0| 74 68 65 72 2e 20 20 4f | 68 2c 20 49 20 61 6d 20 |ther. O|h, I am |
|000001c0| 64 69 73 74 72 69 62 75 | 74 69 6e 67 20 74 68 65 |distribu|ting the|
|000001d0| 73 65 20 69 6e 20 22 73 | 68 61 72 22 20 66 6f 72 |se in "s|har" for|
|000001e0| 6d 61 74 0a 20 20 74 6f | 20 61 76 6f 69 64 20 74 |mat. to| avoid t|
|000001f0| 68 65 20 63 68 69 63 6b | 65 6e 2d 6f 72 2d 65 67 |he chick|en-or-eg|
|00000200| 67 20 70 72 6f 62 6c 65 | 6d 2e 0a 09 2d 20 4a 6f |g proble|m...- Jo|
|00000210| 68 6e 20 4e 65 6c 73 6f | 6e 20 2d 20 6d 6f 64 65 |hn Nelso|n - mode|
|00000220| 72 61 74 6f 72 2c 20 6d | 6f 64 2e 73 6f 75 72 63 |rator, m|od.sourc|
|00000230| 65 73 0a 5d 0a 0a 23 21 | 2f 62 69 6e 2f 73 68 0a |es.]..#!|/bin/sh.|
|00000240| 23 20 54 68 69 73 20 69 | 73 20 61 20 73 68 65 6c |# This i|s a shel|
|00000250| 6c 20 61 72 63 68 69 76 | 65 2c 20 6d 65 61 6e 69 |l archiv|e, meani|
|00000260| 6e 67 3a 0a 23 20 31 2e | 20 52 65 6d 6f 76 65 20 |ng:.# 1.| Remove |
|00000270| 65 76 65 72 79 74 68 69 | 6e 67 20 61 62 6f 76 65 |everythi|ng above|
|00000280| 20 74 68 65 20 23 21 2f | 62 69 6e 2f 73 68 20 6c | the #!/|bin/sh l|
|00000290| 69 6e 65 2e 0a 23 20 32 | 2e 20 53 61 76 65 20 74 |ine..# 2|. Save t|
|000002a0| 68 65 20 72 65 73 75 6c | 74 69 6e 67 20 74 65 78 |he resul|ting tex|
|000002b0| 74 20 69 6e 20 61 20 66 | 69 6c 65 2e 0a 23 20 33 |t in a f|ile..# 3|
|000002c0| 2e 20 45 78 65 63 75 74 | 65 20 74 68 65 20 66 69 |. Execut|e the fi|
|000002d0| 6c 65 20 77 69 74 68 20 | 2f 62 69 6e 2f 73 68 20 |le with |/bin/sh |
|000002e0| 28 6e 6f 74 20 63 73 68 | 29 20 74 6f 20 63 72 65 |(not csh|) to cre|
|000002f0| 61 74 65 20 74 68 65 20 | 66 69 6c 65 73 3a 0a 23 |ate the |files:.#|
|00000300| 09 4d 61 6b 65 66 69 6c | 65 0a 23 09 52 45 41 44 |.Makefil|e.#.READ|
|00000310| 4d 45 0a 23 09 61 72 77 | 72 69 74 65 2e 63 0a 23 |ME.#.arw|rite.c.#|
|00000320| 09 6d 61 69 6e 2e 63 0a | 23 09 73 61 6d 70 6c 65 |.main.c.|#.sample|
|00000330| 0a 23 09 75 6e 70 61 72 | 2e 63 0a 23 20 54 68 69 |.#.unpar|.c.# Thi|
|00000340| 73 20 61 72 63 68 69 76 | 65 20 63 72 65 61 74 65 |s archiv|e create|
|00000350| 64 3a 20 4d 6f 6e 20 41 | 70 72 20 32 31 20 30 39 |d: Mon A|pr 21 09|
|00000360| 3a 34 31 3a 30 36 20 31 | 39 38 36 0a 65 78 70 6f |:41:06 1|986.expo|
|00000370| 72 74 20 50 41 54 48 3b | 20 50 41 54 48 3d 2f 62 |rt PATH;| PATH=/b|
|00000380| 69 6e 3a 24 50 41 54 48 | 0a 69 66 20 74 65 73 74 |in:$PATH|.if test|
|00000390| 20 2d 66 20 27 4d 61 6b | 65 66 69 6c 65 27 0a 74 | -f 'Mak|efile'.t|
|000003a0| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|000003b0| 6f 76 65 72 2d 77 72 69 | 74 69 6e 67 20 65 78 69 |over-wri|ting exi|
|000003c0| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 4d 61 6b |sting fi|le "'Mak|
|000003d0| 65 66 69 6c 65 27 22 0a | 66 69 0a 63 61 74 20 3c |efile'".|fi.cat <|
|000003e0| 3c 20 5c 53 48 41 52 5f | 45 4f 46 20 3e 20 27 4d |< \SHAR_|EOF > 'M|
|000003f0| 61 6b 65 66 69 6c 65 27 | 0a 0a 70 61 72 3a 09 61 |akefile'|..par:.a|
|00000400| 72 77 72 69 74 65 2e 6f | 20 6d 61 69 6e 2e 6f 0a |rwrite.o| main.o.|
|00000410| 09 63 63 20 2d 6f 20 70 | 61 72 20 6d 61 69 6e 2e |.cc -o p|ar main.|
|00000420| 6f 20 61 72 77 72 69 74 | 65 2e 6f 0a 75 6e 70 61 |o arwrit|e.o.unpa|
|00000430| 72 3a 09 75 6e 70 61 72 | 2e 6f 0a 09 63 63 20 2d |r:.unpar|.o..cc -|
|00000440| 6f 20 75 6e 70 61 72 20 | 75 6e 70 61 72 2e 6f 0a |o unpar |unpar.o.|
|00000450| 63 6c 65 61 6e 3a 0a 09 | 72 6d 20 70 61 72 20 75 |clean:..|rm par u|
|00000460| 6e 70 61 72 20 2a 2e 6f | 0a 53 48 41 52 5f 45 4f |npar *.o|.SHAR_EO|
|00000470| 46 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 52 45 |F.if tes|t -f 'RE|
|00000480| 41 44 4d 45 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |ADME'.th|en..echo|
|00000490| 20 73 68 61 72 3a 20 6f | 76 65 72 2d 77 72 69 74 | shar: o|ver-writ|
|000004a0| 69 6e 67 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ing exis|ting fil|
|000004b0| 65 20 22 27 52 45 41 44 | 4d 45 27 22 0a 66 69 0a |e "'READ|ME'".fi.|
|000004c0| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|000004d0| 20 3e 20 27 52 45 41 44 | 4d 45 27 0a 54 68 65 73 | > 'READ|ME'.Thes|
|000004e0| 65 20 70 72 6f 67 72 61 | 6d 73 20 70 61 63 6b 20 |e progra|ms pack |
|000004f0| 61 6e 64 20 75 6e 70 61 | 63 6b 20 66 69 6c 65 73 |and unpa|ck files|
|00000500| 20 69 6e 20 74 68 65 20 | 70 6f 72 74 61 62 6c 65 | in the |portable|
|00000510| 20 61 72 63 68 69 76 65 | 20 66 6f 72 6d 61 74 2e | archive| format.|
|00000520| 0a 54 68 69 73 20 66 6f | 72 6d 61 74 20 69 73 20 |.This fo|rmat is |
|00000530| 63 6f 6d 70 61 74 69 62 | 6c 65 20 77 69 74 68 20 |compatib|le with |
|00000540| 74 68 65 20 61 72 20 63 | 6f 6d 6d 61 6e 64 20 6f |the ar c|ommand o|
|00000550| 6e 20 34 42 53 44 20 61 | 6e 64 20 53 79 73 74 65 |n 4BSD a|nd Syste|
|00000560| 6d 20 56 0a 72 65 6c 65 | 61 73 65 20 32 2e 20 20 |m V.rele|ase 2. |
|00000570| 54 68 65 73 65 20 70 72 | 6f 67 72 61 6d 73 20 61 |These pr|ograms a|
|00000580| 72 65 20 61 76 61 69 6c | 61 62 6c 65 20 66 6f 72 |re avail|able for|
|00000590| 20 75 73 65 20 62 79 20 | 61 6e 79 6f 6e 65 20 77 | use by |anyone w|
|000005a0| 69 74 68 6f 75 74 0a 66 | 65 65 20 6f 72 20 6c 69 |ithout.f|ee or li|
|000005b0| 63 65 6e 73 65 2e 0a 0a | 54 68 65 20 70 61 72 20 |cense...|The par |
|000005c0| 70 72 6f 67 72 61 6d 20 | 70 61 63 6b 73 20 69 6e |program |packs in|
|000005d0| 74 6f 20 70 6f 72 74 61 | 62 6c 65 20 61 72 63 68 |to porta|ble arch|
|000005e0| 69 76 65 20 66 6f 72 6d | 61 74 2e 20 20 54 68 65 |ive form|at. The|
|000005f0| 20 66 69 6c 65 73 20 74 | 6f 0a 77 72 69 74 65 20 | files t|o.write |
|00000600| 61 72 65 20 6e 61 6d 65 | 64 20 6f 6e 20 74 68 65 |are name|d on the|
|00000610| 20 63 6f 6d 6d 61 6e 64 | 20 6c 69 6e 65 2c 20 74 | command| line, t|
|00000620| 68 65 20 72 65 73 75 6c | 74 69 6e 67 20 61 72 63 |he resul|ting arc|
|00000630| 68 69 76 65 20 69 73 0a | 77 72 69 74 74 65 6e 20 |hive is.|written |
|00000640| 6f 6e 20 73 74 64 6f 75 | 74 3a 0a 09 70 61 72 20 |on stdou|t:..par |
|00000650| 66 69 6c 65 31 20 66 69 | 6c 65 32 20 2e 2e 2e 20 |file1 fi|le2 ... |
|00000660| 66 69 6c 65 6e 20 3e 20 | 66 69 6c 65 73 2e 61 0a |filen > |files.a.|
|00000670| 0a 54 68 65 20 75 6e 70 | 61 72 20 70 72 6f 67 72 |.The unp|ar progr|
|00000680| 61 6d 20 75 6e 70 61 63 | 6b 73 20 66 72 6f 6d 20 |am unpac|ks from |
|00000690| 73 74 64 69 6e 20 61 6e | 64 20 77 72 69 74 65 73 |stdin an|d writes|
|000006a0| 20 74 68 65 20 6e 61 6d | 65 64 20 66 69 6c 65 73 | the nam|ed files|
|000006b0| 0a 6f 75 74 20 64 69 72 | 65 63 74 6c 79 3a 0a 09 |.out dir|ectly:..|
|000006c0| 75 6e 70 61 72 20 3c 20 | 66 69 6c 65 73 2e 61 0a |unpar < |files.a.|
|000006d0| 53 48 41 52 5f 45 4f 46 | 0a 69 66 20 74 65 73 74 |SHAR_EOF|.if test|
|000006e0| 20 2d 66 20 27 61 72 77 | 72 69 74 65 2e 63 27 0a | -f 'arw|rite.c'.|
|000006f0| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00000700| 20 6f 76 65 72 2d 77 72 | 69 74 69 6e 67 20 65 78 | over-wr|iting ex|
|00000710| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 22 27 61 72 |isting f|ile "'ar|
|00000720| 77 72 69 74 65 2e 63 27 | 22 0a 66 69 0a 63 61 74 |write.c'|".fi.cat|
|00000730| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00000740| 27 61 72 77 72 69 74 65 | 2e 63 27 0a 2f 2a 0a 20 |'arwrite|.c'./*. |
|00000750| 2a 09 09 43 4f 50 59 52 | 49 47 48 54 20 28 63 29 |*..COPYR|IGHT (c)|
|00000760| 20 48 45 57 4c 45 54 54 | 2d 50 41 43 4b 41 52 44 | HEWLETT|-PACKARD|
|00000770| 20 43 4f 4d 50 41 4e 59 | 2c 20 31 39 38 34 0a 20 | COMPANY|, 1984. |
|00000780| 2a 0a 20 2a 09 50 65 72 | 6d 69 73 73 69 6f 6e 20 |*. *.Per|mission |
|00000790| 69 73 20 67 72 61 6e 74 | 65 64 20 66 6f 72 20 75 |is grant|ed for u|
|000007a0| 6e 6c 69 6d 69 74 65 64 | 20 6d 6f 64 69 66 69 63 |nlimited| modific|
|000007b0| 61 74 69 6f 6e 2c 20 75 | 73 65 2c 20 61 6e 64 0a |ation, u|se, and.|
|000007c0| 20 2a 09 64 69 73 74 72 | 69 62 75 74 69 6f 6e 20 | *.distr|ibution |
|000007d0| 65 78 63 65 70 74 20 74 | 68 61 74 20 74 68 69 73 |except t|hat this|
|000007e0| 20 73 6f 66 74 77 61 72 | 65 20 6d 61 79 20 6e 6f | softwar|e may no|
|000007f0| 74 20 62 65 20 73 6f 6c | 64 20 66 6f 72 0a 20 2a |t be sol|d for. *|
|00000800| 09 70 72 6f 66 69 74 2e | 20 20 4e 6f 20 77 61 72 |.profit.| No war|
|00000810| 72 61 6e 74 79 20 69 73 | 20 69 6d 70 6c 69 65 64 |ranty is| implied|
|00000820| 20 6f 72 20 65 78 70 72 | 65 73 73 65 64 2e 0a 20 | or expr|essed.. |
|00000830| 2a 0a 20 2a 41 75 74 68 | 6f 72 3a 0a 20 2a 09 50 |*. *Auth|or:. *.P|
|00000840| 61 75 6c 20 42 61 6d 65 | 2c 20 48 45 57 4c 45 54 |aul Bame|, HEWLET|
|00000850| 54 2d 50 41 43 4b 41 52 | 44 20 4c 4f 47 49 43 20 |T-PACKAR|D LOGIC |
|00000860| 53 59 53 54 45 4d 53 20 | 44 49 56 49 53 49 4f 4e |SYSTEMS |DIVISION|
|00000870| 20 2d 20 43 6f 6c 6f 72 | 61 64 6f 20 53 70 72 69 | - Color|ado Spri|
|00000880| 6e 67 73 0a 20 2a 09 7b | 20 69 68 6e 70 34 21 68 |ngs. *.{| ihnp4!h|
|00000890| 70 66 63 6c 61 20 7c 20 | 68 70 6c 61 62 73 20 7c |pfcla | |hplabs ||
|000008a0| 20 68 61 72 70 6f 21 68 | 70 2d 70 63 64 20 7d 21 | harpo!h|p-pcd }!|
|000008b0| 68 70 2d 6c 73 64 21 70 | 61 75 6c 0a 20 2a 2f 0a |hp-lsd!p|aul. */.|
|000008c0| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 69 6f 2e |#include| <stdio.|
|000008d0| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 79 73 |h>.#incl|ude <sys|
|000008e0| 2f 74 79 70 65 73 2e 68 | 3e 0a 23 69 6e 63 6c 75 |/types.h|>.#inclu|
|000008f0| 64 65 20 3c 73 79 73 2f | 73 74 61 74 2e 68 3e 0a |de <sys/|stat.h>.|
|00000900| 0a 23 64 65 66 69 6e 65 | 20 41 52 46 4d 41 47 20 |.#define| ARFMAG |
|00000910| 22 60 5c 6e 22 0a 23 64 | 65 66 69 6e 65 20 41 52 |"`\n".#d|efine AR|
|00000920| 4d 41 47 20 22 21 3c 61 | 72 63 68 3e 5c 6e 22 0a |MAG "!<a|rch>\n".|
|00000930| 0a 69 6e 74 0a 61 72 77 | 72 69 74 65 28 66 69 6c |.int.arw|rite(fil|
|00000940| 65 6e 61 6d 65 2c 73 74 | 72 65 61 6d 29 0a 63 68 |ename,st|ream).ch|
|00000950| 61 72 20 2a 66 69 6c 65 | 6e 61 6d 65 3b 0a 46 49 |ar *file|name;.FI|
|00000960| 4c 45 20 2a 73 74 72 65 | 61 6d 3b 0a 2f 2a 0a 20 |LE *stre|am;./*. |
|00000970| 2a 09 57 72 69 74 65 20 | 74 68 65 20 66 69 6c 65 |*.Write |the file|
|00000980| 20 64 65 6e 6f 74 65 64 | 20 62 79 20 27 66 69 6c | denoted| by 'fil|
|00000990| 65 6e 61 6d 65 27 20 74 | 6f 20 27 73 74 72 65 61 |ename' t|o 'strea|
|000009a0| 6d 27 20 69 6e 20 70 6f | 72 74 61 62 6c 65 20 61 |m' in po|rtable a|
|000009b0| 72 20 66 6f 72 6d 61 74 | 2e 0a 20 2a 09 41 6e 79 |r format|.. *.Any|
|000009c0| 20 73 74 72 65 61 6d 20 | 70 6f 73 69 74 69 6f 6e | stream |position|
|000009d0| 69 6e 67 20 69 73 20 61 | 73 73 75 6d 65 64 20 74 |ing is a|ssumed t|
|000009e0| 6f 20 61 6c 72 65 61 64 | 79 20 62 65 20 64 6f 6e |o alread|y be don|
|000009f0| 65 2e 0a 20 2a 0a 20 2a | 09 61 72 77 72 69 74 65 |e.. *. *|.arwrite|
|00000a00| 28 29 20 6e 6f 72 6d 61 | 6c 6c 79 20 72 65 74 75 |() norma|lly retu|
|00000a10| 72 6e 73 20 30 20 62 75 | 74 20 72 65 74 75 72 6e |rns 0 bu|t return|
|00000a20| 73 20 2d 31 20 69 6e 20 | 63 61 73 65 20 6f 66 20 |s -1 in |case of |
|00000a30| 65 72 72 6f 72 73 2e 20 | 20 65 72 72 6e 6f 0a 20 |errors. | errno. |
|00000a40| 2a 09 6d 61 79 20 62 65 | 20 69 6e 73 70 65 63 74 |*.may be| inspect|
|00000a50| 65 64 20 74 6f 20 64 65 | 74 65 72 6d 69 6e 65 20 |ed to de|termine |
|00000a60| 74 68 65 20 63 61 75 73 | 65 20 6f 66 20 74 68 65 |the caus|e of the|
|00000a70| 20 65 72 72 6f 72 2e 0a | 20 2a 0a 20 2a 09 49 66 | error..| *. *.If|
|00000a80| 20 6e 65 63 65 73 73 61 | 72 79 2c 20 74 68 65 20 | necessa|ry, the |
|00000a90| 73 74 72 65 61 6d 20 69 | 73 20 70 61 64 64 65 64 |stream i|s padded|
|00000aa0| 20 77 69 74 68 20 5c 6e | 27 73 20 74 6f 20 6d 61 | with \n|'s to ma|
|00000ab0| 74 63 68 20 74 68 65 20 | 65 76 65 6e 20 62 6f 75 |tch the |even bou|
|00000ac0| 6e 64 61 72 79 0a 20 2a | 09 63 6f 6e 64 69 74 69 |ndary. *|.conditi|
|00000ad0| 6f 6e 2e 0a 20 2a 2f 0a | 7b 0a 09 73 74 72 75 63 |on.. */.|{..struc|
|00000ae0| 74 20 73 74 61 74 20 73 | 74 61 74 62 75 66 3b 0a |t stat s|tatbuf;.|
|00000af0| 09 46 49 4c 45 20 2a 69 | 6e 73 74 72 65 61 6d 3b |.FILE *i|nstream;|
|00000b00| 0a 09 6c 6f 6e 67 20 69 | 3b 0a 0a 09 2f 2a 20 73 |..long i|;.../* s|
|00000b10| 74 61 74 28 29 20 74 68 | 65 20 66 69 6c 65 20 74 |tat() th|e file t|
|00000b20| 6f 20 67 65 74 20 74 68 | 65 20 73 74 75 66 66 20 |o get th|e stuff |
|00000b30| 66 6f 72 20 74 68 65 20 | 68 65 61 64 65 72 20 2a |for the |header *|
|00000b40| 2f 0a 09 69 66 28 20 73 | 74 61 74 28 66 69 6c 65 |/..if( s|tat(file|
|00000b50| 6e 61 6d 65 2c 26 73 74 | 61 74 62 75 66 29 20 3c |name,&st|atbuf) <|
|00000b60| 20 30 20 29 0a 09 7b 0a | 09 09 2f 2a 20 65 72 72 | 0 )..{.|../* err|
|00000b70| 6f 72 21 20 2a 2f 0a 09 | 09 72 65 74 75 72 6e 28 |or! */..|.return(|
|00000b80| 2d 31 29 3b 0a 09 7d 0a | 0a 09 2f 2a 20 4f 70 65 |-1);..}.|../* Ope|
|00000b90| 6e 20 66 69 6c 65 20 66 | 6f 72 20 72 65 61 64 69 |n file f|or readi|
|00000ba0| 6e 67 20 2a 2f 0a 09 69 | 66 28 20 28 69 6e 73 74 |ng */..i|f( (inst|
|00000bb0| 72 65 61 6d 20 3d 20 66 | 6f 70 65 6e 28 66 69 6c |ream = f|open(fil|
|00000bc0| 65 6e 61 6d 65 2c 22 72 | 22 29 29 20 3d 3d 20 4e |ename,"r|")) == N|
|00000bd0| 55 4c 4c 20 29 0a 09 7b | 0a 09 09 2f 2a 20 65 72 |ULL )..{|.../* er|
|00000be0| 72 6f 72 21 20 2a 2f 0a | 09 09 72 65 74 75 72 6e |ror! */.|..return|
|00000bf0| 28 2d 31 29 3b 0a 09 7d | 0a 0a 09 2f 2a 20 4e 6f |(-1);..}|.../* No|
|00000c00| 77 20 77 72 69 74 65 20 | 74 68 65 20 68 65 61 64 |w write |the head|
|00000c10| 65 72 20 2a 2f 0a 09 2f | 2a 20 54 68 69 73 20 69 |er */../|* This i|
|00000c20| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 67 6c 65 61 6e |nformati|on glean|
|00000c30| 65 64 20 66 72 6f 6d 20 | 61 72 28 34 29 20 69 6e |ed from |ar(4) in|
|00000c40| 20 56 2e 32 20 2a 2f 0a | 09 66 70 72 69 6e 74 66 | V.2 */.|.fprintf|
|00000c50| 28 73 74 72 65 61 6d 2c | 0a 09 09 22 25 2d 31 36 |(stream,|..."%-16|
|00000c60| 73 25 2d 31 32 6c 64 25 | 2d 36 64 25 2d 36 64 25 |s%-12ld%|-6d%-6d%|
|00000c70| 2d 38 6f 25 2d 31 30 6c | 64 25 32 73 22 2c 0a 09 |-8o%-10l|d%2s",..|
|00000c80| 09 66 69 6c 65 6e 61 6d | 65 2c 0a 09 09 73 74 61 |.filenam|e,...sta|
|00000c90| 74 62 75 66 2e 73 74 5f | 6d 74 69 6d 65 2c 0a 09 |tbuf.st_|mtime,..|
|00000ca0| 09 73 74 61 74 62 75 66 | 2e 73 74 5f 75 69 64 2c |.statbuf|.st_uid,|
|00000cb0| 0a 09 09 73 74 61 74 62 | 75 66 2e 73 74 5f 67 69 |...statb|uf.st_gi|
|00000cc0| 64 2c 0a 09 09 73 74 61 | 74 62 75 66 2e 73 74 5f |d,...sta|tbuf.st_|
|00000cd0| 6d 6f 64 65 2c 0a 09 09 | 73 74 61 74 62 75 66 2e |mode,...|statbuf.|
|00000ce0| 73 74 5f 73 69 7a 65 2c | 0a 09 09 41 52 46 4d 41 |st_size,|...ARFMA|
|00000cf0| 47 0a 09 09 29 3b 0a 0a | 09 2f 2a 20 41 6e 64 20 |G...);..|./* And |
|00000d00| 63 6f 70 79 20 74 68 65 | 20 66 69 6c 65 20 2a 2f |copy the| file */|
|00000d10| 0a 09 2f 2a 20 20 20 4e | 6f 74 65 20 74 68 61 74 |../* N|ote that|
|00000d20| 20 74 68 65 72 65 20 69 | 73 20 6e 6f 20 65 72 72 | there i|s no err|
|00000d30| 6f 72 20 72 65 63 6f 76 | 65 72 79 20 68 65 72 65 |or recov|ery here|
|00000d40| 21 20 2a 2f 0a 09 66 6f | 72 28 20 69 20 3d 20 30 |! */..fo|r( i = 0|
|00000d50| 20 3b 20 69 20 3c 20 73 | 74 61 74 62 75 66 2e 73 | ; i < s|tatbuf.s|
|00000d60| 74 5f 73 69 7a 65 20 3b | 20 69 2b 2b 20 29 0a 09 |t_size ;| i++ )..|
|00000d70| 7b 0a 09 09 66 70 75 74 | 63 28 66 67 65 74 63 28 |{...fput|c(fgetc(|
|00000d80| 69 6e 73 74 72 65 61 6d | 29 2c 73 74 72 65 61 6d |instream|),stream|
|00000d90| 29 3b 0a 09 7d 0a 0a 09 | 2f 2a 20 61 6e 64 20 63 |);..}...|/* and c|
|00000da0| 6c 6f 73 65 20 2a 2f 0a | 09 63 6c 6f 73 65 28 69 |lose */.|.close(i|
|00000db0| 6e 73 74 72 65 61 6d 29 | 3b 0a 0a 09 2f 2a 20 61 |nstream)|;.../* a|
|00000dc0| 6e 64 20 70 61 64 20 6f | 75 74 70 75 74 20 73 74 |nd pad o|utput st|
|00000dd0| 72 65 61 6d 20 2a 2f 0a | 09 69 66 28 20 28 66 74 |ream */.|.if( (ft|
|00000de0| 65 6c 6c 28 73 74 72 65 | 61 6d 29 20 26 20 30 78 |ell(stre|am) & 0x|
|00000df0| 31 29 20 21 3d 20 30 20 | 29 0a 09 7b 0a 09 09 2f |1) != 0 |)..{.../|
|00000e00| 2a 20 69 66 20 6f 66 66 | 73 65 74 20 69 73 20 6f |* if off|set is o|
|00000e10| 64 64 2c 20 70 61 64 20 | 77 69 74 68 20 61 20 6e |dd, pad |with a n|
|00000e20| 75 6c 69 6e 65 20 2a 2f | 0a 09 09 66 70 75 74 63 |uline */|...fputc|
|00000e30| 28 27 5c 6e 27 2c 73 74 | 72 65 61 6d 29 3b 0a 09 |('\n',st|ream);..|
|00000e40| 7d 0a 09 72 65 74 75 72 | 6e 28 30 29 3b 0a 7d 0a |}..retur|n(0);.}.|
|00000e50| 0a 61 72 68 64 77 72 69 | 74 65 28 73 74 72 65 61 |.arhdwri|te(strea|
|00000e60| 6d 29 0a 46 49 4c 45 20 | 2a 73 74 72 65 61 6d 3b |m).FILE |*stream;|
|00000e70| 0a 2f 2a 0a 20 2a 09 57 | 72 69 74 65 20 74 68 65 |./*. *.W|rite the|
|00000e80| 20 61 72 63 68 69 76 65 | 20 68 65 61 64 65 72 20 | archive| header |
|00000e90| 6f 6e 74 6f 20 27 73 74 | 72 65 61 6d 27 0a 20 2a |onto 'st|ream'. *|
|00000ea0| 2f 0a 7b 0a 09 66 70 72 | 69 6e 74 66 28 73 74 72 |/.{..fpr|intf(str|
|00000eb0| 65 61 6d 2c 22 25 73 22 | 2c 41 52 4d 41 47 29 3b |eam,"%s"|,ARMAG);|
|00000ec0| 0a 7d 0a 53 48 41 52 5f | 45 4f 46 0a 69 66 20 74 |.}.SHAR_|EOF.if t|
|00000ed0| 65 73 74 20 2d 66 20 27 | 6d 61 69 6e 2e 63 27 0a |est -f '|main.c'.|
|00000ee0| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00000ef0| 20 6f 76 65 72 2d 77 72 | 69 74 69 6e 67 20 65 78 | over-wr|iting ex|
|00000f00| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 22 27 6d 61 |isting f|ile "'ma|
|00000f10| 69 6e 2e 63 27 22 0a 66 | 69 0a 63 61 74 20 3c 3c |in.c'".f|i.cat <<|
|00000f20| 20 5c 53 48 41 52 5f 45 | 4f 46 20 3e 20 27 6d 61 | \SHAR_E|OF > 'ma|
|00000f30| 69 6e 2e 63 27 0a 2f 2a | 0a 20 2a 09 09 43 4f 50 |in.c'./*|. *..COP|
|00000f40| 59 52 49 47 48 54 20 28 | 63 29 20 48 45 57 4c 45 |YRIGHT (|c) HEWLE|
|00000f50| 54 54 2d 50 41 43 4b 41 | 52 44 20 43 4f 4d 50 41 |TT-PACKA|RD COMPA|
|00000f60| 4e 59 2c 20 31 39 38 34 | 0a 20 2a 0a 20 2a 09 50 |NY, 1984|. *. *.P|
|00000f70| 65 72 6d 69 73 73 69 6f | 6e 20 69 73 20 67 72 61 |ermissio|n is gra|
|00000f80| 6e 74 65 64 20 66 6f 72 | 20 75 6e 6c 69 6d 69 74 |nted for| unlimit|
|00000f90| 65 64 20 6d 6f 64 69 66 | 69 63 61 74 69 6f 6e 2c |ed modif|ication,|
|00000fa0| 20 75 73 65 2c 20 61 6e | 64 0a 20 2a 09 64 69 73 | use, an|d. *.dis|
|00000fb0| 74 72 69 62 75 74 69 6f | 6e 20 65 78 63 65 70 74 |tributio|n except|
|00000fc0| 20 74 68 61 74 20 74 68 | 69 73 20 73 6f 66 74 77 | that th|is softw|
|00000fd0| 61 72 65 20 6d 61 79 20 | 6e 6f 74 20 62 65 20 73 |are may |not be s|
|00000fe0| 6f 6c 64 20 66 6f 72 0a | 20 2a 09 70 72 6f 66 69 |old for.| *.profi|
|00000ff0| 74 2e 20 20 4e 6f 20 77 | 61 72 72 61 6e 74 79 20 |t. No w|arranty |
|00001000| 69 73 20 69 6d 70 6c 69 | 65 64 20 6f 72 20 65 78 |is impli|ed or ex|
|00001010| 70 72 65 73 73 65 64 2e | 0a 20 2a 0a 20 2a 41 75 |pressed.|. *. *Au|
|00001020| 74 68 6f 72 3a 0a 20 2a | 09 50 61 75 6c 20 42 61 |thor:. *|.Paul Ba|
|00001030| 6d 65 2c 20 48 45 57 4c | 45 54 54 2d 50 41 43 4b |me, HEWL|ETT-PACK|
|00001040| 41 52 44 20 4c 4f 47 49 | 43 20 53 59 53 54 45 4d |ARD LOGI|C SYSTEM|
|00001050| 53 20 44 49 56 49 53 49 | 4f 4e 20 2d 20 43 6f 6c |S DIVISI|ON - Col|
|00001060| 6f 72 61 64 6f 20 53 70 | 72 69 6e 67 73 0a 20 2a |orado Sp|rings. *|
|00001070| 09 7b 20 69 68 6e 70 34 | 21 68 70 66 63 6c 61 20 |.{ ihnp4|!hpfcla |
|00001080| 7c 20 68 70 6c 61 62 73 | 20 7c 20 68 61 72 70 6f || hplabs| | harpo|
|00001090| 21 68 70 2d 70 63 64 20 | 7d 21 68 70 2d 6c 73 64 |!hp-pcd |}!hp-lsd|
|000010a0| 21 70 61 75 6c 0a 20 2a | 2f 0a 23 69 6e 63 6c 75 |!paul. *|/.#inclu|
|000010b0| 64 65 20 3c 73 74 64 69 | 6f 2e 68 3e 0a 0a 65 78 |de <stdi|o.h>..ex|
|000010c0| 74 65 72 6e 09 69 6e 74 | 09 61 72 77 72 69 74 65 |tern.int|.arwrite|
|000010d0| 28 29 3b 0a 65 78 74 65 | 72 6e 09 09 61 72 68 64 |();.exte|rn..arhd|
|000010e0| 77 72 69 74 65 28 29 3b | 0a 0a 6d 61 69 6e 28 61 |write();|..main(a|
|000010f0| 72 67 63 2c 61 72 67 76 | 29 0a 69 6e 74 20 61 72 |rgc,argv|).int ar|
|00001100| 67 63 3b 0a 63 68 61 72 | 20 2a 61 72 67 76 5b 5d |gc;.char| *argv[]|
|00001110| 3b 0a 2f 2a 0a 20 2a 09 | 57 72 69 74 65 20 74 68 |;./*. *.|Write th|
|00001120| 65 20 6e 61 6d 65 64 20 | 66 69 6c 65 73 20 28 69 |e named |files (i|
|00001130| 6e 20 61 72 67 76 29 20 | 74 6f 20 73 74 64 6f 75 |n argv) |to stdou|
|00001140| 74 20 69 6e 20 70 6f 72 | 74 61 62 6c 65 20 61 72 |t in por|table ar|
|00001150| 20 66 6f 72 6d 61 74 2e | 0a 20 2a 2f 0a 7b 0a 09 | format.|. */.{..|
|00001160| 69 6e 74 20 69 3b 0a 0a | 09 69 66 28 20 61 72 67 |int i;..|.if( arg|
|00001170| 63 20 3c 20 32 20 29 0a | 09 7b 0a 09 09 66 70 72 |c < 2 ).|.{...fpr|
|00001180| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 22 55 73 61 |intf(std|err,"Usa|
|00001190| 67 65 3a 20 25 73 20 66 | 69 6c 65 31 20 5b 66 69 |ge: %s f|ile1 [fi|
|000011a0| 6c 65 2e 2e 2e 5d 5c 6e | 22 2c 61 72 67 76 5b 30 |le...]\n|",argv[0|
|000011b0| 5d 29 3b 0a 09 09 65 78 | 69 74 28 31 29 3b 0a 09 |]);...ex|it(1);..|
|000011c0| 7d 0a 0a 09 2f 2a 20 57 | 72 69 74 65 20 74 68 65 |}.../* W|rite the|
|000011d0| 20 68 65 61 64 65 72 20 | 2a 2f 0a 09 61 72 68 64 | header |*/..arhd|
|000011e0| 77 72 69 74 65 28 73 74 | 64 6f 75 74 29 3b 0a 0a |write(st|dout);..|
|000011f0| 09 2f 2a 20 61 6e 64 20 | 74 68 65 20 66 69 6c 65 |./* and |the file|
|00001200| 73 20 2a 2f 0a 09 66 6f | 72 28 20 69 20 3d 20 31 |s */..fo|r( i = 1|
|00001210| 20 3b 20 69 20 3c 20 61 | 72 67 63 20 3b 20 69 2b | ; i < a|rgc ; i+|
|00001220| 2b 20 29 0a 09 7b 0a 09 | 09 69 66 28 20 61 72 77 |+ )..{..|.if( arw|
|00001230| 72 69 74 65 28 61 72 67 | 76 5b 69 5d 2c 73 74 64 |rite(arg|v[i],std|
|00001240| 6f 75 74 29 20 3c 20 30 | 20 29 0a 09 09 7b 0a 09 |out) < 0| )...{..|
|00001250| 09 09 70 65 72 72 6f 72 | 28 61 72 67 76 5b 69 5d |..perror|(argv[i]|
|00001260| 29 3b 0a 09 09 09 65 78 | 69 74 28 31 29 3b 0a 09 |);....ex|it(1);..|
|00001270| 09 7d 0a 09 7d 0a 09 65 | 78 69 74 28 30 29 3b 0a |.}..}..e|xit(0);.|
|00001280| 7d 0a 53 48 41 52 5f 45 | 4f 46 0a 69 66 20 74 65 |}.SHAR_E|OF.if te|
|00001290| 73 74 20 2d 66 20 27 73 | 61 6d 70 6c 65 27 0a 74 |st -f 's|ample'.t|
|000012a0| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|000012b0| 6f 76 65 72 2d 77 72 69 | 74 69 6e 67 20 65 78 69 |over-wri|ting exi|
|000012c0| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 73 61 6d |sting fi|le "'sam|
|000012d0| 70 6c 65 27 22 0a 66 69 | 0a 63 61 74 20 3c 3c 20 |ple'".fi|.cat << |
|000012e0| 5c 53 48 41 52 5f 45 4f | 46 20 3e 20 27 73 61 6d |\SHAR_EO|F > 'sam|
|000012f0| 70 6c 65 27 0a 21 3c 61 | 72 63 68 3e 0a 66 6f 6f |ple'.!<a|rch>.foo|
|00001300| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 34 35 38 | | 458|
|00001310| 37 36 34 33 30 39 20 20 | 20 31 32 20 20 20 20 30 |764309 | 12 0|
|00001320| 20 20 20 20 20 31 30 30 | 36 36 36 20 20 32 39 20 | 100|666 29 |
|00001330| 20 20 20 20 20 20 20 60 | 0a 53 75 6e 20 4a 75 6c | `|.Sun Jul|
|00001340| 20 31 35 20 31 34 3a 33 | 31 3a 34 39 20 45 44 54 | 15 14:3|1:49 EDT|
|00001350| 20 31 39 38 34 0a 0a 62 | 61 72 20 20 20 20 20 20 | 1984..b|ar |
|00001360| 20 20 20 20 20 20 20 34 | 35 38 37 36 34 33 31 33 | 4|58764313|
|00001370| 20 20 20 31 32 20 20 20 | 20 30 20 20 20 20 20 31 | 12 | 0 1|
|00001380| 30 30 36 36 36 20 20 31 | 38 39 20 20 20 20 20 20 |00666 1|89 |
|00001390| 20 60 0a 73 61 72 67 65 | 20 20 20 20 74 74 79 61 | `.sarge| ttya|
|000013a0| 20 20 20 20 4a 75 6c 20 | 31 33 20 31 30 3a 30 32 | Jul |13 10:02|
|000013b0| 0a 6a 67 73 20 20 20 20 | 20 20 74 74 79 73 31 20 |.jgs | ttys1 |
|000013c0| 20 20 4a 75 6c 20 31 35 | 20 31 30 3a 34 35 0a 6d | Jul 15| 10:45.m|
|000013d0| 61 72 6b 20 20 20 20 20 | 74 74 79 70 30 20 20 20 |ark |ttyp0 |
|000013e0| 4a 75 6c 20 31 35 20 31 | 34 3a 30 37 09 28 63 62 |Jul 15 1|4:07.(cb|
|000013f0| 6f 73 67 64 29 0a 6d 61 | 72 6b 20 20 20 20 20 74 |osgd).ma|rk t|
|00001400| 74 79 70 31 20 20 20 4a | 75 6c 20 31 33 20 30 39 |typ1 J|ul 13 09|
|00001410| 3a 33 36 0a 6d 61 72 6b | 20 20 20 20 20 74 74 79 |:36.mark| tty|
|00001420| 70 32 20 20 20 4a 75 6c | 20 31 33 20 30 39 3a 33 |p2 Jul| 13 09:3|
|00001430| 36 0a 6d 61 72 6b 20 20 | 20 20 20 74 74 79 70 33 |6.mark | ttyp3|
|00001440| 20 20 20 4a 75 6c 20 31 | 33 20 31 36 3a 35 37 0a | Jul 1|3 16:57.|
|00001450| 0a 0a 53 48 41 52 5f 45 | 4f 46 0a 69 66 20 74 65 |..SHAR_E|OF.if te|
|00001460| 73 74 20 2d 66 20 27 75 | 6e 70 61 72 2e 63 27 0a |st -f 'u|npar.c'.|
|00001470| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00001480| 20 6f 76 65 72 2d 77 72 | 69 74 69 6e 67 20 65 78 | over-wr|iting ex|
|00001490| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 22 27 75 6e |isting f|ile "'un|
|000014a0| 70 61 72 2e 63 27 22 0a | 66 69 0a 63 61 74 20 3c |par.c'".|fi.cat <|
|000014b0| 3c 20 5c 53 48 41 52 5f | 45 4f 46 20 3e 20 27 75 |< \SHAR_|EOF > 'u|
|000014c0| 6e 70 61 72 2e 63 27 0a | 2f 2a 20 75 6e 70 61 63 |npar.c'.|/* unpac|
|000014d0| 6b 20 70 6f 72 74 61 62 | 6c 65 20 61 72 63 68 69 |k portab|le archi|
|000014e0| 76 65 73 20 2d 20 77 72 | 69 74 74 65 6e 20 62 79 |ves - wr|itten by|
|000014f0| 20 42 69 6c 6c 20 57 65 | 6c 63 68 20 2a 2f 0a 23 | Bill We|lch */.#|
|00001500| 69 6e 63 6c 75 64 65 20 | 3c 73 74 64 69 6f 2e 68 |include |<stdio.h|
|00001510| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 79 73 2f |>.#inclu|de <sys/|
|00001520| 74 79 70 65 73 2e 68 3e | 0a 0a 63 68 61 72 20 62 |types.h>|..char b|
|00001530| 75 66 5b 35 31 32 5d 3b | 0a 6d 61 69 6e 28 29 0a |uf[512];|.main().|
|00001540| 7b 0a 09 63 68 61 72 20 | 6e 61 6d 65 5b 38 30 5d |{..char |name[80]|
|00001550| 3b 0a 09 73 74 72 75 63 | 74 20 75 74 69 6d 62 75 |;..struc|t utimbu|
|00001560| 66 20 7b 0a 09 09 74 69 | 6d 65 5f 74 20 61 63 74 |f {...ti|me_t act|
|00001570| 69 6d 65 3b 0a 09 09 74 | 69 6d 65 5f 74 20 6d 6f |ime;...t|ime_t mo|
|00001580| 64 74 69 6d 65 3b 0a 09 | 7d 20 74 69 6d 65 73 3b |dtime;..|} times;|
|00001590| 0a 09 6c 6f 6e 67 20 6d | 74 69 6d 65 3b 0a 09 69 |..long m|time;..i|
|000015a0| 6e 74 20 75 69 64 2c 20 | 67 69 64 2c 20 6d 6f 64 |nt uid, |gid, mod|
|000015b0| 65 3b 0a 09 6c 6f 6e 67 | 20 6c 65 6e 2c 20 69 3b |e;..long| len, i;|
|000015c0| 0a 09 46 49 4c 45 20 2a | 66 70 3b 0a 0a 09 77 68 |..FILE *|fp;...wh|
|000015d0| 69 6c 65 28 67 65 74 73 | 28 62 75 66 29 20 21 3d |ile(gets|(buf) !=|
|000015e0| 20 4e 55 4c 4c 29 7b 0a | 09 09 69 66 20 28 62 75 | NULL){.|..if (bu|
|000015f0| 66 5b 73 74 72 6c 65 6e | 28 62 75 66 29 20 2d 20 |f[strlen|(buf) - |
|00001600| 31 5d 20 3d 3d 20 27 60 | 27 29 20 7b 0a 09 09 09 |1] == '`|') {....|
|00001610| 70 72 69 6e 74 66 28 22 | 25 73 5c 6e 22 2c 20 62 |printf("|%s\n", b|
|00001620| 75 66 29 3b 0a 09 09 09 | 73 73 63 61 6e 66 28 62 |uf);....|sscanf(b|
|00001630| 75 66 2c 20 22 25 73 20 | 25 6c 64 20 25 64 20 25 |uf, "%s |%ld %d %|
|00001640| 64 20 25 6f 20 25 6c 64 | 22 2c 20 6e 61 6d 65 2c |d %o %ld|", name,|
|00001650| 26 6d 74 69 6d 65 2c 26 | 75 69 64 2c 26 67 69 64 |&mtime,&|uid,&gid|
|00001660| 2c 0a 09 09 09 09 09 26 | 6d 6f 64 65 2c 20 26 6c |,......&|mode, &l|
|00001670| 65 6e 29 3b 0a 09 09 09 | 70 72 69 6e 74 66 28 22 |en);....|printf("|
|00001680| 25 73 20 25 6c 64 5c 6e | 22 2c 20 6e 61 6d 65 2c |%s %ld\n|", name,|
|00001690| 20 6c 65 6e 29 3b 0a 09 | 09 09 66 70 20 3d 20 66 | len);..|..fp = f|
|000016a0| 6f 70 65 6e 28 6e 61 6d | 65 2c 20 22 77 22 29 3b |open(nam|e, "w");|
|000016b0| 0a 09 09 09 66 6f 72 20 | 28 69 3d 30 3b 20 69 3c |....for |(i=0; i<|
|000016c0| 6c 65 6e 3b 20 69 2b 2b | 29 20 70 75 74 63 28 67 |len; i++|) putc(g|
|000016d0| 65 74 63 68 61 72 28 29 | 2c 20 66 70 29 3b 0a 09 |etchar()|, fp);..|
|000016e0| 09 09 66 63 6c 6f 73 65 | 28 66 70 29 3b 0a 09 09 |..fclose|(fp);...|
|000016f0| 09 74 69 6d 65 73 2e 61 | 63 74 69 6d 65 20 3d 20 |.times.a|ctime = |
|00001700| 74 69 6d 65 73 2e 6d 6f | 64 74 69 6d 65 20 3d 20 |times.mo|dtime = |
|00001710| 6d 74 69 6d 65 3b 0a 09 | 09 09 2f 2a 20 49 66 20 |mtime;..|../* If |
|00001720| 79 6f 75 20 64 6f 6e 27 | 74 20 68 61 76 65 20 75 |you don'|t have u|
|00001730| 74 69 6d 65 2c 20 6a 75 | 73 74 20 72 65 6d 6f 76 |time, ju|st remov|
|00001740| 65 20 6e 65 78 74 20 34 | 20 6c 69 6e 65 73 20 2a |e next 4| lines *|
|00001750| 2f 0a 09 09 09 69 66 28 | 20 75 74 69 6d 65 28 6e |/....if(| utime(n|
|00001760| 61 6d 65 2c 26 74 69 6d | 65 73 29 20 3c 20 30 20 |ame,&tim|es) < 0 |
|00001770| 29 0a 09 09 09 7b 0a 09 | 09 09 09 70 65 72 72 6f |)....{..|...perro|
|00001780| 72 28 22 43 61 6e 27 74 | 20 6d 6f 64 69 66 79 20 |r("Can't| modify |
|00001790| 64 61 74 65 22 29 3b 0a | 09 09 09 7d 0a 09 09 09 |date");.|...}....|
|000017a0| 69 66 28 20 63 68 6d 6f | 64 28 6e 61 6d 65 2c 6d |if( chmo|d(name,m|
|000017b0| 6f 64 65 29 20 3c 20 30 | 20 29 0a 09 09 09 7b 0a |ode) < 0| )....{.|
|000017c0| 09 09 09 09 70 65 72 72 | 6f 72 28 22 43 61 6e 27 |....perr|or("Can'|
|000017d0| 74 20 6d 6f 64 69 66 79 | 20 6d 6f 64 65 22 29 3b |t modify| mode");|
|000017e0| 0a 09 09 09 7d 0a 09 09 | 7d 0a 09 7d 0a 7d 0a 53 |....}...|}..}.}.S|
|000017f0| 48 41 52 5f 45 4f 46 0a | 23 09 45 6e 64 20 6f 66 |HAR_EOF.|#.End of|
|00001800| 20 73 68 65 6c 6c 20 61 | 72 63 68 69 76 65 0a 65 | shell a|rchive.e|
|00001810| 78 69 74 20 30 0a 0a 0a | 0a 0a |xit 0...|.. |
+--------+-------------------------+-------------------------+--------+--------+