home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume3 / can2 < prev    next >
SHell self-extracting ARchive  |  1989-02-03  |  25.7 KB

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was processed as: SHell self-extracting ARchive (archive/shar).

You can browse this item here: can2

ConfidenceProgramDetectionMatch TypeSupport
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, ASCII text, with overstriking default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK 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/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 78 61 | 6e 74 68 21 6d 63 6e 63 |Path: xa|nth!mcnc|
|00000010| 21 67 61 74 65 63 68 21 | 6d 61 6e 64 72 69 6c 6c |!gatech!|mandrill|
|00000020| 21 68 61 6c 21 6e 63 6f | 61 73 74 21 61 6c 6c 62 |!hal!nco|ast!allb|
|00000030| 65 72 79 0a 46 72 6f 6d | 3a 20 61 74 68 65 79 40 |ery.From|: athey@|
|00000040| 63 6f 64 2e 6e 6f 73 63 | 2e 6d 69 6c 20 28 54 68 |cod.nosc|.mil (Th|
|00000050| 65 20 42 69 74 20 42 75 | 74 63 68 65 72 29 0a 4e |e Bit Bu|tcher).N|
|00000060| 65 77 73 67 72 6f 75 70 | 73 3a 20 63 6f 6d 70 2e |ewsgroup|s: comp.|
|00000070| 73 6f 75 72 63 65 73 2e | 6d 69 73 63 0a 53 75 62 |sources.|misc.Sub|
|00000080| 6a 65 63 74 3a 20 76 30 | 33 69 30 37 35 3a 20 22 |ject: v0|3i075: "|
|00000090| 63 61 6e 22 20 61 20 66 | 61 73 74 20 22 43 22 20 |can" a f|ast "C" |
|000000a0| 76 65 72 73 69 6f 6e 2c | 20 61 20 67 72 65 61 74 |version,| a great|
|000000b0| 20 61 6c 69 61 73 20 66 | 6f 72 20 22 72 6d 22 0a | alias f|or "rm".|
|000000c0| 4d 65 73 73 61 67 65 2d | 49 44 3a 20 3c 38 38 30 |Message-|ID: <880|
|000000d0| 37 30 37 32 30 31 31 2e | 41 41 30 38 38 34 31 40 |7072011.|AA08841@|
|000000e0| 63 6f 64 2e 6e 6f 73 63 | 2e 6d 69 6c 3e 0a 44 61 |cod.nosc|.mil>.Da|
|000000f0| 74 65 3a 20 37 20 4a 75 | 6c 20 38 38 20 32 30 3a |te: 7 Ju|l 88 20:|
|00000100| 31 31 3a 30 36 20 47 4d | 54 0a 53 65 6e 64 65 72 |11:06 GM|T.Sender|
|00000110| 3a 20 61 6c 6c 62 65 72 | 79 40 6e 63 6f 61 73 74 |: allber|y@ncoast|
|00000120| 2e 55 55 43 50 0a 52 65 | 70 6c 79 2d 54 6f 3a 20 |.UUCP.Re|ply-To: |
|00000130| 61 74 68 65 79 40 63 6f | 64 2e 6e 6f 73 63 2e 6d |athey@co|d.nosc.m|
|00000140| 69 6c 20 28 54 68 65 20 | 42 69 74 20 42 75 74 63 |il (The |Bit Butc|
|00000150| 68 65 72 29 0a 4c 69 6e | 65 73 3a 20 38 38 34 0a |her).Lin|es: 884.|
|00000160| 41 70 70 72 6f 76 65 64 | 3a 20 61 6c 6c 62 65 72 |Approved|: allber|
|00000170| 79 40 6e 63 6f 61 73 74 | 2e 55 55 43 50 0a 0a 50 |y@ncoast|.UUCP..P|
|00000180| 6f 73 74 69 6e 67 2d 6e | 75 6d 62 65 72 3a 20 56 |osting-n|umber: V|
|00000190| 6f 6c 75 6d 65 20 33 2c | 20 49 73 73 75 65 20 37 |olume 3,| Issue 7|
|000001a0| 35 0a 53 75 62 6d 69 74 | 74 65 64 2d 62 79 3a 20 |5.Submit|ted-by: |
|000001b0| 22 54 68 65 20 42 69 74 | 20 42 75 74 63 68 65 72 |"The Bit| Butcher|
|000001c0| 22 20 3c 61 74 68 65 79 | 40 63 6f 64 2e 6e 6f 73 |" <athey|@cod.nos|
|000001d0| 63 2e 6d 69 6c 3e 0a 41 | 72 63 68 69 76 65 2d 6e |c.mil>.A|rchive-n|
|000001e0| 61 6d 65 3a 20 63 61 6e | 32 0a 0a 09 54 68 69 73 |ame: can|2...This|
|000001f0| 20 69 73 20 61 20 22 43 | 22 20 76 65 72 73 69 6f | is a "C|" versio|
|00000200| 6e 20 6f 66 20 61 6e 20 | 65 61 72 6c 69 65 72 20 |n of an |earlier |
|00000210| 70 6f 73 74 69 6e 67 20 | 6f 66 20 6d 69 6e 65 2e |posting |of mine.|
|00000220| 20 20 49 74 20 69 73 20 | 61 0a 67 72 65 61 74 20 | It is |a.great |
|00000230| 61 6c 69 61 73 20 66 6f | 72 20 22 72 6d 22 2e 20 |alias fo|r "rm". |
|00000240| 20 49 74 20 6d 6f 76 65 | 73 20 74 68 65 20 66 69 | It move|s the fi|
|00000250| 6c 65 20 74 6f 20 79 6f | 75 72 20 70 65 72 73 6f |le to yo|ur perso|
|00000260| 6e 61 6c 20 74 72 61 73 | 68 63 61 6e 2e 0a 49 66 |nal tras|hcan..If|
|00000270| 20 79 6f 75 20 61 72 65 | 20 63 6f 6e 73 69 73 74 | you are| consist|
|00000280| 65 6e 74 6c 79 20 62 6f | 74 68 65 72 65 64 20 62 |ently bo|thered b|
|00000290| 79 20 75 73 65 72 73 20 | 6f 72 20 61 72 65 20 61 |y users |or are a|
|000002a0| 20 75 73 65 72 20 79 6f | 75 72 73 65 6c 66 0a 77 | user yo|urself.w|
|000002b0| 68 6f 20 69 73 20 62 6f | 74 68 65 72 65 64 20 62 |ho is bo|thered b|
|000002c0| 79 20 79 6f 75 20 6f 77 | 6e 20 69 6e 65 70 74 69 |y you ow|n inepti|
|000002d0| 74 75 64 65 20 69 6e 20 | 72 65 6d 6f 76 61 6c 20 |tude in |removal |
|000002e0| 6f 66 20 66 69 6c 65 73 | 20 79 6f 75 0a 72 65 61 |of files| you.rea|
|000002f0| 6c 69 7a 65 20 79 6f 75 | 20 72 65 61 6c 6c 79 20 |lize you| really |
|00000300| 64 6f 6e 27 74 20 77 61 | 6e 74 20 67 6f 6e 65 20 |don't wa|nt gone |
|00000310| 74 68 65 6e 20 74 68 69 | 73 20 69 73 20 6a 75 73 |then thi|s is jus|
|00000320| 74 20 74 68 65 20 74 68 | 69 6e 67 20 66 6f 72 0a |t the th|ing for.|
|00000330| 79 6f 75 2e 20 20 45 6e | 6a 6f 79 2e 0a 0a 09 59 |you. En|joy....Y|
|00000340| 65 73 2c 20 49 20 6b 6e | 6f 77 20 74 68 61 74 20 |es, I kn|ow that |
|00000350| 74 68 69 73 20 69 73 20 | 61 6d 61 7a 69 6e 67 6c |this is |amazingl|
|00000360| 79 20 73 69 6d 69 6c 69 | 61 72 20 74 6f 20 74 68 |y simili|ar to th|
|00000370| 65 20 22 72 6d 75 6e 72 | 6d 22 0a 70 61 63 6b 61 |e "rmunr|m".packa|
|00000380| 67 65 20 74 68 61 74 20 | 63 61 6e 20 62 65 20 66 |ge that |can be f|
|00000390| 6f 75 6e 64 20 61 74 20 | 73 69 6d 74 65 6c 32 30 |ound at |simtel20|
|000003a0| 2c 20 62 75 74 20 49 20 | 6a 75 73 74 20 74 68 6f |, but I |just tho|
|000003b0| 75 67 68 74 20 74 68 61 | 74 20 73 69 6e 63 65 0a |ught tha|t since.|
|000003c0| 6d 69 6e 65 20 69 73 20 | 70 72 65 74 74 79 20 66 |mine is |pretty f|
|000003d0| 61 73 74 20 61 6e 64 20 | 68 61 73 20 73 6f 6d 65 |ast and |has some|
|000003e0| 20 6e 69 63 65 20 6f 70 | 74 69 6f 6e 73 2c 20 61 | nice op|tions, a|
|000003f0| 74 20 6c 65 61 73 74 20 | 61 73 20 66 61 72 0a 61 |t least |as far.a|
|00000400| 73 20 49 20 61 6d 20 63 | 6f 6e 63 65 72 6e 65 64 |s I am c|oncerned|
|00000410| 2e 20 20 4f 6e 65 20 74 | 68 69 6e 67 20 74 68 61 |. One t|hing tha|
|00000420| 74 20 74 68 65 20 6f 74 | 68 65 72 20 70 61 63 6b |t the ot|her pack|
|00000430| 61 67 65 20 64 6f 65 73 | 20 74 68 61 74 20 49 0a |age does| that I.|
|00000440| 64 6f 6e 27 74 20 69 73 | 20 70 72 65 73 65 72 76 |don't is| preserv|
|00000450| 65 20 64 69 72 65 63 74 | 6f 72 69 65 73 2e 20 20 |e direct|ories. |
|00000460| 49 6e 20 6f 74 68 65 72 | 20 77 6f 72 64 73 2c 20 |In other| words, |
|00000470| 69 66 20 79 6f 75 20 22 | 63 61 6e 22 20 74 77 6f |if you "|can" two|
|00000480| 0a 66 69 6c 65 73 20 77 | 69 74 68 20 74 68 65 20 |.files w|ith the |
|00000490| 73 61 6d 65 20 6e 61 6d | 65 20 79 6f 75 20 77 69 |same nam|e you wi|
|000004a0| 6c 6c 20 6f 6e 6c 79 20 | 68 61 76 65 20 74 68 65 |ll only |have the|
|000004b0| 20 6c 61 73 74 20 6f 6e | 65 20 79 6f 75 20 22 63 | last on|e you "c|
|000004c0| 61 6e 22 6e 65 64 2e 0a | 0a 09 09 09 2d 74 68 65 |an"ned..|....-the|
|000004d0| 20 62 69 74 20 62 75 74 | 63 68 65 72 0a 0a 6d 61 | bit but|cher..ma|
|000004e0| 69 6c 20 6d 65 3a 20 20 | 20 61 74 68 65 79 40 6e |il me: | athey@n|
|000004f0| 6f 73 63 2e 6d 69 6c 0a | 0a 23 21 20 2f 62 69 6e |osc.mil.|.#! /bin|
|00000500| 2f 73 68 0a 23 20 54 68 | 69 73 20 69 73 20 61 20 |/sh.# Th|is is a |
|00000510| 73 68 65 6c 6c 20 61 72 | 63 68 69 76 65 2e 20 20 |shell ar|chive. |
|00000520| 52 65 6d 6f 76 65 20 61 | 6e 79 74 68 69 6e 67 20 |Remove a|nything |
|00000530| 62 65 66 6f 72 65 20 74 | 68 69 73 20 6c 69 6e 65 |before t|his line|
|00000540| 2c 20 74 68 65 6e 20 75 | 6e 70 61 63 6b 0a 23 20 |, then u|npack.# |
|00000550| 69 74 20 62 79 20 73 61 | 76 69 6e 67 20 69 74 20 |it by sa|ving it |
|00000560| 69 6e 74 6f 20 61 20 66 | 69 6c 65 20 61 6e 64 20 |into a f|ile and |
|00000570| 74 79 70 69 6e 67 20 22 | 73 68 20 66 69 6c 65 22 |typing "|sh file"|
|00000580| 2e 20 20 54 6f 20 6f 76 | 65 72 77 72 69 74 65 20 |. To ov|erwrite |
|00000590| 65 78 69 73 74 69 6e 67 | 0a 23 20 66 69 6c 65 73 |existing|.# files|
|000005a0| 2c 20 74 79 70 65 20 22 | 73 68 20 66 69 6c 65 20 |, type "|sh file |
|000005b0| 2d 63 22 2e 20 20 59 6f | 75 20 63 61 6e 20 61 6c |-c". Yo|u can al|
|000005c0| 73 6f 20 66 65 65 64 20 | 74 68 69 73 20 61 73 20 |so feed |this as |
|000005d0| 73 74 61 6e 64 61 72 64 | 20 69 6e 70 75 74 20 76 |standard| input v|
|000005e0| 69 61 0a 23 20 75 6e 73 | 68 61 72 2c 20 6f 72 20 |ia.# uns|har, or |
|000005f0| 62 79 20 74 79 70 69 6e | 67 20 22 73 68 20 3c 66 |by typin|g "sh <f|
|00000600| 69 6c 65 22 2c 20 65 2e | 67 2e 2e 20 20 49 66 20 |ile", e.|g.. If |
|00000610| 74 68 69 73 20 61 72 63 | 68 69 76 65 20 69 73 20 |this arc|hive is |
|00000620| 63 6f 6d 70 6c 65 74 65 | 2c 20 79 6f 75 0a 23 20 |complete|, you.# |
|00000630| 77 69 6c 6c 20 73 65 65 | 20 74 68 65 20 66 6f 6c |will see| the fol|
|00000640| 6c 6f 77 69 6e 67 20 6d | 65 73 73 61 67 65 20 61 |lowing m|essage a|
|00000650| 74 20 74 68 65 20 65 6e | 64 3a 0a 23 09 09 22 45 |t the en|d:.#.."E|
|00000660| 6e 64 20 6f 66 20 73 68 | 65 6c 6c 20 61 72 63 68 |nd of sh|ell arch|
|00000670| 69 76 65 2e 22 0a 23 20 | 43 6f 6e 74 65 6e 74 73 |ive.".# |Contents|
|00000680| 3a 20 20 52 65 61 64 4d | 65 20 4d 61 6b 65 66 69 |: ReadM|e Makefi|
|00000690| 6c 65 2e 42 53 44 20 4d | 61 6b 65 66 69 6c 65 2e |le.BSD M|akefile.|
|000006a0| 53 55 4e 20 4d 61 6b 65 | 66 69 6c 65 2e 53 59 53 |SUN Make|file.SYS|
|000006b0| 56 20 63 61 6e 2e 31 20 | 63 61 6e 2e 63 0a 23 20 |V can.1 |can.c.# |
|000006c0| 20 20 63 61 6e 2e 68 20 | 65 6d 70 74 79 74 72 61 | can.h |emptytra|
|000006d0| 73 68 20 65 6d 70 74 79 | 74 72 61 73 68 2e 38 20 |sh empty|trash.8 |
|000006e0| 72 65 63 75 72 63 61 6e | 2e 63 20 78 64 65 76 63 |recurcan|.c xdevc|
|000006f0| 61 6e 2e 63 0a 23 20 57 | 72 61 70 70 65 64 20 62 |an.c.# W|rapped b|
|00000700| 79 20 61 74 68 65 79 40 | 75 6e 69 63 6f 72 6e 20 |y athey@|unicorn |
|00000710| 6f 6e 20 54 68 75 20 4a | 75 6c 20 20 37 20 31 30 |on Thu J|ul 7 10|
|00000720| 3a 33 35 3a 30 31 20 31 | 39 38 38 0a 50 41 54 48 |:35:01 1|988.PATH|
|00000730| 3d 2f 62 69 6e 3a 2f 75 | 73 72 2f 62 69 6e 3a 2f |=/bin:/u|sr/bin:/|
|00000740| 75 73 72 2f 75 63 62 20 | 3b 20 65 78 70 6f 72 74 |usr/ucb |; export|
|00000750| 20 50 41 54 48 0a 69 66 | 20 74 65 73 74 20 2d 66 | PATH.if| test -f|
|00000760| 20 27 52 65 61 64 4d 65 | 27 20 2d 61 20 22 24 7b | 'ReadMe|' -a "${|
|00000770| 31 7d 22 20 21 3d 20 22 | 2d 63 22 20 3b 20 74 68 |1}" != "|-c" ; th|
|00000780| 65 6e 20 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |en . ec|ho shar:|
|00000790| 20 57 69 6c 6c 20 6e 6f | 74 20 63 6c 6f 62 62 65 | Will no|t clobbe|
|000007a0| 72 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |r existi|ng file |
|000007b0| 5c 22 27 52 65 61 64 4d | 65 27 5c 22 0a 65 6c 73 |\"'ReadM|e'\".els|
|000007c0| 65 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 45 78 74 |e.echo s|har: Ext|
|000007d0| 72 61 63 74 69 6e 67 20 | 5c 22 27 52 65 61 64 4d |racting |\"'ReadM|
|000007e0| 65 27 5c 22 20 5c 28 32 | 34 35 36 20 63 68 61 72 |e'\" \(2|456 char|
|000007f0| 61 63 74 65 72 73 5c 29 | 0a 73 65 64 20 22 73 2f |acters\)|.sed "s/|
|00000800| 5e 58 2f 2f 22 20 3e 27 | 52 65 61 64 4d 65 27 20 |^X//" >'|ReadMe' |
|00000810| 3c 3c 27 45 4e 44 5f 4f | 46 5f 46 49 4c 45 27 0a |<<'END_O|F_FILE'.|
|00000820| 58 57 65 6c 6c 2c 20 49 | 20 61 6d 20 62 61 63 6b |XWell, I| am back|
|00000830| 20 61 67 61 69 6e 20 61 | 6e 64 20 79 6f 75 20 6d | again a|nd you m|
|00000840| 61 79 20 6e 6f 74 20 62 | 65 20 72 65 6a 6f 69 63 |ay not b|e rejoic|
|00000850| 69 6e 67 2e 0a 58 0a 58 | 54 68 69 73 20 69 73 20 |ing..X.X|This is |
|00000860| 43 41 4e 20 32 2e 30 2e | 0a 58 59 65 73 20 69 74 |CAN 2.0.|.XYes it|
|00000870| 20 69 73 20 61 6c 6c 20 | 28 61 6c 6d 6f 73 74 20 | is all |(almost |
|00000880| 61 6c 6c 29 20 6e 65 77 | 2e 0a 58 0a 58 46 69 72 |all) new|..X.XFir|
|00000890| 73 74 2c 20 77 68 61 74 | 20 79 6f 75 20 6e 65 65 |st, what| you nee|
|000008a0| 64 20 74 6f 20 64 6f 20 | 74 6f 20 6d 61 6b 65 20 |d to do |to make |
|000008b0| 74 68 69 73 20 6e 69 66 | 74 79 20 74 68 69 6e 67 |this nif|ty thing|
|000008c0| 20 66 6f 72 20 79 6f 75 | 72 73 65 6c 66 0a 58 6f | for you|rself.Xo|
|000008d0| 72 20 79 6f 75 72 20 73 | 79 73 74 65 6d 20 28 69 |r your s|ystem (i|
|000008e0| 66 20 79 6f 75 20 61 72 | 65 20 74 68 65 20 73 79 |f you ar|e the sy|
|000008f0| 73 74 65 6d 20 6d 61 6e | 61 67 65 72 29 0a 58 0a |stem man|ager).X.|
|00000900| 58 31 2e 20 20 43 6f 70 | 79 20 74 68 65 20 61 70 |X1. Cop|y the ap|
|00000910| 70 72 6f 70 72 69 61 74 | 65 20 4d 61 6b 65 66 69 |propriat|e Makefi|
|00000920| 6c 65 20 74 6f 20 4d 61 | 6b 65 66 69 6c 65 20 61 |le to Ma|kefile a|
|00000930| 6e 64 20 74 68 65 6e 20 | 63 6f 6d 70 69 6c 65 2e |nd then |compile.|
|00000940| 0a 58 32 2e 20 20 45 64 | 69 74 20 65 6d 70 74 79 |.X2. Ed|it empty|
|00000950| 74 72 61 73 68 20 74 6f | 20 6d 61 6b 65 20 69 74 |trash to| make it|
|00000960| 20 6c 6f 6f 6b 20 69 6e | 20 74 68 65 20 74 72 61 | look in| the tra|
|00000970| 73 68 63 61 6e 73 20 6f | 66 20 79 6f 75 72 20 73 |shcans o|f your s|
|00000980| 79 73 74 65 6d 2e 0a 58 | 33 2e 20 20 49 6e 73 74 |ystem..X|3. Inst|
|00000990| 61 6c 6c 20 61 6c 6c 20 | 6f 66 20 74 68 69 73 20 |all all |of this |
|000009a0| 77 6f 6e 64 65 72 66 75 | 6c 20 73 74 75 66 66 20 |wonderfu|l stuff |
|000009b0| 28 44 6f 6e 27 74 20 66 | 6f 72 67 65 74 20 74 68 |(Don't f|orget th|
|000009c0| 65 20 6d 61 6e 20 70 61 | 67 65 73 29 2e 0a 58 20 |e man pa|ges)..X |
|000009d0| 20 20 20 4d 61 6b 65 20 | 73 75 72 65 20 74 6f 20 | Make |sure to |
|000009e0| 6d 61 6b 65 20 22 65 6d | 70 74 79 74 72 61 73 68 |make "em|ptytrash|
|000009f0| 22 20 65 78 65 63 75 74 | 61 62 6c 65 20 62 79 20 |" execut|able by |
|00000a00| 74 68 65 20 63 72 6f 6e | 74 61 62 20 74 68 61 74 |the cron|tab that|
|00000a10| 20 77 69 6c 6c 20 72 75 | 6e 20 69 74 2e 0a 58 0a | will ru|n it..X.|
|00000a20| 58 53 65 63 6f 6e 64 2c | 20 53 6f 20 77 68 79 20 |XSecond,| So why |
|00000a30| 68 61 76 65 20 79 6f 75 | 20 77 61 73 74 65 64 20 |have you| wasted |
|00000a40| 6d 79 20 74 69 6d 65 20 | 61 67 61 69 6e 20 6f 72 |my time |again or|
|00000a50| 20 77 68 79 20 76 65 72 | 73 69 6f 6e 20 32 2e 30 | why ver|sion 2.0|
|00000a60| 3f 0a 58 0a 58 31 2e 20 | 20 57 65 6c 6c 2c 20 49 |?.X.X1. | Well, I|
|00000a70| 20 72 65 77 72 6f 74 65 | 20 74 68 65 20 65 6e 74 | rewrote| the ent|
|00000a80| 69 72 65 20 63 61 6e 20 | 69 6e 20 43 2e 20 20 54 |ire can |in C. T|
|00000a90| 68 69 73 20 6d 61 64 65 | 20 69 74 20 6d 6f 76 65 |his made| it move|
|00000aa0| 20 74 77 69 63 65 20 61 | 73 20 66 61 73 74 2e 0a | twice a|s fast..|
|00000ab0| 58 09 53 74 69 6c 6c 20 | 61 20 6c 69 74 74 6c 65 |X.Still |a little|
|00000ac0| 20 73 6c 6f 77 65 72 20 | 74 68 61 6e 20 72 6d 20 | slower |than rm |
|00000ad0| 62 75 74 20 63 65 72 74 | 61 69 6e 6c 79 20 6d 75 |but cert|ainly mu|
|00000ae0| 63 68 20 6e 69 63 65 72 | 2e 0a 58 32 2e 20 20 49 |ch nicer|..X2. I|
|00000af0| 6e 20 74 68 65 20 70 72 | 6f 63 65 73 73 20 6f 66 |n the pr|ocess of|
|00000b00| 20 72 65 77 72 69 74 69 | 6e 67 20 69 74 2c 20 49 | rewriti|ng it, I|
|00000b10| 20 61 64 64 65 64 20 74 | 68 65 20 76 65 72 62 6f | added t|he verbo|
|00000b20| 73 65 20 6f 70 74 69 6f | 6e 20 61 6e 64 20 74 68 |se optio|n and th|
|00000b30| 65 20 0a 58 09 69 6e 74 | 65 72 61 63 74 69 76 65 |e .X.int|eractive|
|00000b40| 20 6f 70 74 69 6f 6e 2e | 0a 58 0a 58 54 68 69 72 | option.|.X.XThir|
|00000b50| 64 2c 20 54 68 65 72 65 | 20 61 72 65 20 73 6f 6d |d, There| are som|
|00000b60| 65 20 74 68 69 6e 67 73 | 20 61 62 6f 75 74 20 74 |e things| about t|
|00000b70| 68 69 73 20 74 68 61 74 | 20 79 6f 75 20 73 68 6f |his that| you sho|
|00000b80| 75 6c 64 20 6b 6e 6f 77 | 2e 0a 58 0a 58 31 2e 20 |uld know|..X.X1. |
|00000b90| 20 54 68 69 73 20 69 73 | 20 6d 79 20 66 69 72 73 | This is| my firs|
|00000ba0| 74 20 61 74 74 65 6d 70 | 74 20 61 74 20 61 20 22 |t attemp|t at a "|
|00000bb0| 43 22 20 75 74 69 6c 69 | 74 79 20 62 75 74 20 61 |C" utili|ty but a|
|00000bc0| 73 20 66 61 72 20 61 73 | 20 49 20 63 61 6e 20 74 |s far as| I can t|
|00000bd0| 65 6c 6c 2c 0a 58 09 69 | 74 20 64 6f 65 73 20 74 |ell,.X.i|t does t|
|00000be0| 68 65 20 74 72 69 63 6b | 2e 0a 58 32 2e 20 20 49 |he trick|..X2. I|
|00000bf0| 74 20 6f 6e 6c 79 20 63 | 68 61 6e 67 65 73 20 74 |t only c|hanges t|
|00000c00| 68 65 20 61 63 63 65 73 | 73 20 74 69 6d 65 2c 20 |he acces|s time, |
|00000c10| 6e 6f 74 20 74 68 65 20 | 6d 6f 64 69 66 69 63 61 |not the |modifica|
|00000c20| 74 69 6f 6e 20 74 69 6d | 65 20 61 6e 64 20 74 68 |tion tim|e and th|
|00000c30| 65 6e 0a 58 09 65 6d 70 | 74 69 65 73 20 74 72 61 |en.X.emp|ties tra|
|00000c40| 73 68 20 6f 6e 20 74 68 | 65 20 62 61 73 69 73 20 |sh on th|e basis |
|00000c50| 6f 66 20 61 63 63 65 73 | 73 20 74 69 6d 65 2e 20 |of acces|s time. |
|00000c60| 20 53 6f 2c 20 69 66 20 | 79 6f 75 20 61 72 65 20 | So, if |you are |
|00000c70| 72 65 61 6c 6c 79 0a 58 | 09 68 61 72 64 2d 63 6f |really.X|.hard-co|
|00000c80| 72 65 2c 20 79 6f 75 20 | 63 61 6e 20 73 65 65 20 |re, you |can see |
|00000c90| 69 66 20 74 68 65 20 6f | 6e 65 20 79 6f 75 20 72 |if the o|ne you r|
|00000ca0| 65 6d 6f 76 65 64 20 61 | 6e 64 20 74 68 65 6e 20 |emoved a|nd then |
|00000cb0| 72 65 63 6f 76 65 72 65 | 64 20 69 73 0a 58 09 72 |recovere|d is.X.r|
|00000cc0| 65 61 6c 6c 79 20 74 68 | 65 20 76 65 72 73 69 6f |eally th|e versio|
|00000cd0| 6e 20 79 6f 75 20 77 61 | 6e 74 2e 0a 58 33 2e 20 |n you wa|nt..X3. |
|00000ce0| 20 54 68 69 73 20 68 61 | 73 20 74 68 65 20 73 61 | This ha|s the sa|
|00000cf0| 6d 65 20 68 61 6e 64 69 | 63 61 70 20 61 73 20 6d |me handi|cap as m|
|00000d00| 79 20 6f 72 69 67 69 6e | 61 6c 20 73 63 72 69 70 |y origin|al scrip|
|00000d10| 74 2e 20 20 59 6f 75 20 | 63 61 6e 20 6f 6e 6c 79 |t. You |can only|
|00000d20| 20 72 65 63 6f 76 65 72 | 0a 58 09 6f 6e 65 20 66 | recover|.X.one f|
|00000d30| 69 6c 65 20 61 74 20 61 | 20 74 69 6d 65 2c 20 61 |ile at a| time, a|
|00000d40| 6e 64 20 79 6f 75 20 6d | 75 73 74 20 6b 6e 6f 77 |nd you m|ust know|
|00000d50| 20 69 74 27 73 20 73 70 | 65 63 69 66 69 63 20 6e | it's sp|ecific n|
|00000d60| 61 6d 65 2e 20 20 49 66 | 20 49 20 68 61 76 65 0a |ame. If| I have.|
|00000d70| 58 09 74 69 6d 65 20 49 | 20 77 69 6c 6c 20 74 72 |X.time I| will tr|
|00000d80| 79 20 6d 79 20 62 65 73 | 74 20 74 6f 20 66 69 78 |y my bes|t to fix|
|00000d90| 20 74 68 69 73 20 70 72 | 6f 62 6c 65 6d 2e 0a 58 | this pr|oblem..X|
|00000da0| 34 2e 20 20 54 68 65 20 | 6c 69 73 74 69 6e 67 20 |4. The |listing |
|00000db0| 6f 70 74 69 6f 6e 20 69 | 73 20 76 65 72 79 20 70 |option i|s very p|
|00000dc0| 72 69 6d 69 74 69 76 65 | 20 62 75 74 20 73 69 6e |rimitive| but sin|
|00000dd0| 63 65 20 69 74 20 74 72 | 61 76 65 72 73 65 73 20 |ce it tr|averses |
|00000de0| 74 68 65 0a 58 09 64 69 | 72 65 63 74 6f 72 79 20 |the.X.di|rectory |
|00000df0| 74 72 65 65 20 62 79 20 | 77 68 65 72 65 20 69 74 |tree by |where it|
|00000e00| 20 69 73 20 70 6c 61 63 | 65 64 2c 20 74 68 65 20 | is plac|ed, the |
|00000e10| 6c 61 73 74 20 74 68 69 | 6e 67 73 20 63 61 6e 6e |last thi|ngs cann|
|00000e20| 65 64 20 61 72 65 0a 58 | 09 75 73 75 61 6c 6c 79 |ed are.X|.usually|
|00000e30| 20 61 74 20 74 68 65 20 | 65 6e 64 20 6f 66 20 74 | at the |end of t|
|00000e40| 68 65 20 6c 69 73 74 2e | 20 20 49 2c 20 6f 6e 63 |he list.| I, onc|
|00000e50| 65 20 61 67 61 69 6e 2c | 20 77 69 6c 6c 20 64 6f |e again,| will do|
|00000e60| 20 77 68 61 74 20 49 20 | 63 61 6e 0a 58 09 74 6f | what I |can.X.to|
|00000e70| 20 72 65 70 61 69 72 20 | 74 68 65 73 65 20 66 65 | repair |these fe|
|00000e80| 61 74 75 72 65 73 20 28 | 62 75 67 73 3f 29 2e 0a |atures (|bugs?)..|
|00000e90| 58 35 2e 20 20 54 68 69 | 73 20 69 73 20 6d 79 20 |X5. Thi|s is my |
|00000ea0| 66 69 72 73 74 20 74 69 | 6d 65 20 70 61 73 73 69 |first ti|me passi|
|00000eb0| 6e 67 20 61 72 6f 75 6e | 64 20 6d 75 6c 74 69 70 |ng aroun|d multip|
|00000ec0| 6c 65 20 73 79 73 74 65 | 6d 20 64 65 73 69 67 6e |le syste|m design|
|00000ed0| 73 2e 0a 58 09 49 66 20 | 49 20 68 61 76 65 20 61 |s..X.If |I have a|
|00000ee0| 20 70 6f 6f 72 20 63 6f | 6e 63 65 70 74 69 6f 6e | poor co|nception|
|00000ef0| 20 6f 66 20 77 68 61 74 | 20 61 6e 79 20 73 79 73 | of what| any sys|
|00000f00| 74 65 6d 20 69 73 20 6c | 69 6b 65 20 70 6c 65 61 |tem is l|ike plea|
|00000f10| 73 65 20 6c 65 74 0a 58 | 09 6d 65 20 6b 6e 6f 77 |se let.X|.me know|
|00000f20| 20 61 74 20 74 68 65 20 | 61 64 64 72 65 73 73 20 | at the |address |
|00000f30| 62 65 6c 6f 77 2e 20 28 | 72 68 79 6d 65 3f 29 0a |below. (|rhyme?).|
|00000f40| 58 36 2e 20 20 59 6f 75 | 20 6d 61 79 20 68 61 76 |X6. You| may hav|
|00000f50| 65 20 74 68 65 20 70 6f | 73 73 69 62 69 6c 69 74 |e the po|ssibilit|
|00000f60| 79 20 6f 66 20 61 20 70 | 61 74 68 6e 61 6d 65 20 |y of a p|athname |
|00000f70| 67 72 65 61 74 65 72 20 | 74 68 61 6e 20 38 30 2e |greater |than 80.|
|00000f80| 20 20 49 20 72 61 72 65 | 6c 79 20 64 6f 2e 0a 58 | I rare|ly do..X|
|00000f90| 09 54 6f 20 72 65 6d 65 | 64 79 20 61 6e 79 20 70 |.To reme|dy any p|
|00000fa0| 72 6f 62 6c 65 6d 73 20 | 63 61 75 73 65 64 20 62 |roblems |caused b|
|00000fb0| 79 20 74 68 69 73 2c 20 | 73 69 6d 70 6c 79 20 63 |y this, |simply c|
|00000fc0| 68 61 6e 67 65 20 74 68 | 65 20 64 65 66 69 6e 65 |hange th|e define|
|00000fd0| 0a 58 09 65 6e 74 69 74 | 6c 65 64 20 4d 41 58 50 |.X.entit|led MAXP|
|00000fe0| 41 54 48 4c 45 4e 2e 0a | 58 37 2e 20 20 4d 61 79 |ATHLEN..|X7. May|
|00000ff0| 20 62 65 20 70 6f 73 73 | 69 62 6c 65 20 74 6f 20 | be poss|ible to |
|00001000| 61 64 64 20 61 20 66 6f | 72 63 65 20 6f 70 74 69 |add a fo|rce opti|
|00001010| 6f 6e 2c 20 62 75 74 20 | 49 20 64 6f 6e 27 74 20 |on, but |I don't |
|00001020| 73 65 65 20 74 68 65 20 | 6e 65 63 65 73 73 69 74 |see the |necessit|
|00001030| 79 0a 58 09 6f 66 20 69 | 74 20 72 69 67 68 74 20 |y.X.of i|t right |
|00001040| 6e 6f 77 2e 0a 58 0a 58 | 49 66 20 79 6f 75 20 68 |now..X.X|If you h|
|00001050| 61 76 65 20 61 6e 79 20 | 63 6f 6d 70 6c 61 69 6e |ave any |complain|
|00001060| 74 73 20 6f 72 20 79 6f | 75 20 68 61 76 65 20 62 |ts or yo|u have b|
|00001070| 75 67 20 66 69 78 65 73 | 20 6f 72 0a 58 61 6e 79 |ug fixes| or.Xany|
|00001080| 74 68 69 6e 67 20 6f 66 | 20 74 68 65 20 73 6f 72 |thing of| the sor|
|00001090| 74 20 70 6c 65 61 73 65 | 20 77 72 69 74 65 20 6d |t please| write m|
|000010a0| 65 20 61 74 0a 58 0a 58 | 20 20 20 20 20 20 20 20 |e at.X.X| |
|000010b0| 20 20 20 20 22 61 74 68 | 65 79 40 6e 6f 73 63 2e | "ath|ey@nosc.|
|000010c0| 6d 69 6c 22 0a 58 0a 58 | 50 6c 65 61 73 65 20 77 |mil".X.X|Please w|
|000010d0| 72 69 74 65 20 6d 65 20 | 69 66 20 79 6f 75 20 69 |rite me |if you i|
|000010e0| 6e 73 74 61 6c 6c 20 74 | 68 69 73 20 61 6e 64 20 |nstall t|his and |
|000010f0| 66 69 6e 64 20 69 74 20 | 75 73 65 66 75 6c 2e 0a |find it |useful..|
|00001100| 58 4a 75 73 74 20 61 20 | 71 75 69 63 6b 20 6e 6f |XJust a |quick no|
|00001110| 74 65 20 77 6f 75 6c 64 | 20 62 65 20 67 72 65 61 |te would| be grea|
|00001120| 74 2c 20 65 76 65 72 79 | 62 6f 64 79 2e 0a 58 49 |t, every|body..XI|
|00001130| 20 6d 65 61 6e 20 6c 65 | 74 20 6d 65 20 6b 6e 6f | mean le|t me kno|
|00001140| 77 20 69 66 20 49 20 73 | 68 6f 75 6c 64 20 6b 65 |w if I s|hould ke|
|00001150| 65 70 20 70 6f 73 74 69 | 6e 67 20 74 68 69 73 20 |ep posti|ng this |
|00001160| 61 72 74 77 6f 72 6b 20 | 28 6a 75 6e 6b 3f 29 2e |artwork |(junk?).|
|00001170| 0a 58 09 09 2d 74 68 65 | 20 62 69 74 20 62 75 74 |.X..-the| bit but|
|00001180| 63 68 65 72 0a 58 0a 58 | 4e 4f 54 45 3a 20 43 41 |cher.X.X|NOTE: CA|
|00001190| 4e 20 32 2e 30 31 20 20 | 6e 6f 77 20 77 65 20 63 |N 2.01 |now we c|
|000011a0| 61 6e 20 64 65 61 6c 20 | 77 69 74 68 20 63 72 6f |an deal |with cro|
|000011b0| 73 73 20 64 65 76 69 63 | 65 20 63 61 6e 6e 69 6e |ss devic|e cannin|
|000011c0| 67 2e 0a 58 4e 4f 54 45 | 3a 20 43 41 4e 20 32 2e |g..XNOTE|: CAN 2.|
|000011d0| 30 32 20 20 73 65 67 6d | 65 6e 74 65 64 20 61 6e |02 segm|ented an|
|000011e0| 64 20 63 6c 65 61 6e 65 | 64 20 63 6f 64 65 2e 0a |d cleane|d code..|
|000011f0| 45 4e 44 5f 4f 46 5f 46 | 49 4c 45 0a 69 66 20 74 |END_OF_F|ILE.if t|
|00001200| 65 73 74 20 32 34 35 36 | 20 2d 6e 65 20 60 77 63 |est 2456| -ne `wc|
|00001210| 20 2d 63 20 3c 27 52 65 | 61 64 4d 65 27 60 3b 20 | -c <'Re|adMe'`; |
|00001220| 74 68 65 6e 0a 20 20 20 | 20 65 63 68 6f 20 73 68 |then. | echo sh|
|00001230| 61 72 3a 20 5c 22 27 52 | 65 61 64 4d 65 27 5c 22 |ar: \"'R|eadMe'\"|
|00001240| 20 75 6e 70 61 63 6b 65 | 64 20 77 69 74 68 20 77 | unpacke|d with w|
|00001250| 72 6f 6e 67 20 73 69 7a | 65 21 0a 66 69 0a 23 20 |rong siz|e!.fi.# |
|00001260| 65 6e 64 20 6f 66 20 27 | 52 65 61 64 4d 65 27 0a |end of '|ReadMe'.|
|00001270| 66 69 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 4d |fi.if te|st -f 'M|
|00001280| 61 6b 65 66 69 6c 65 2e | 42 53 44 27 20 2d 61 20 |akefile.|BSD' -a |
|00001290| 22 24 7b 31 7d 22 20 21 | 3d 20 22 2d 63 22 20 3b |"${1}" !|= "-c" ;|
|000012a0| 20 74 68 65 6e 20 0a 20 | 20 65 63 68 6f 20 73 68 | then . | echo sh|
|000012b0| 61 72 3a 20 57 69 6c 6c | 20 6e 6f 74 20 63 6c 6f |ar: Will| not clo|
|000012c0| 62 62 65 72 20 65 78 69 | 73 74 69 6e 67 20 66 69 |bber exi|sting fi|
|000012d0| 6c 65 20 5c 22 27 4d 61 | 6b 65 66 69 6c 65 2e 42 |le \"'Ma|kefile.B|
|000012e0| 53 44 27 5c 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |SD'\".el|se.echo |
|000012f0| 73 68 61 72 3a 20 45 78 | 74 72 61 63 74 69 6e 67 |shar: Ex|tracting|
|00001300| 20 5c 22 27 4d 61 6b 65 | 66 69 6c 65 2e 42 53 44 | \"'Make|file.BSD|
|00001310| 27 5c 22 20 5c 28 33 30 | 37 20 63 68 61 72 61 63 |'\" \(30|7 charac|
|00001320| 74 65 72 73 5c 29 0a 73 | 65 64 20 22 73 2f 5e 58 |ters\).s|ed "s/^X|
|00001330| 2f 2f 22 20 3e 27 4d 61 | 6b 65 66 69 6c 65 2e 42 |//" >'Ma|kefile.B|
|00001340| 53 44 27 20 3c 3c 27 45 | 4e 44 5f 4f 46 5f 46 49 |SD' <<'E|ND_OF_FI|
|00001350| 4c 45 27 0a 58 43 46 4c | 41 47 53 20 20 20 20 20 |LE'.XCFL|AGS |
|00001360| 20 20 20 3d 20 2d 4f 20 | 2d 44 42 53 44 0a 58 0a | = -O |-DBSD.X.|
|00001370| 58 44 45 53 54 09 20 20 | 20 20 20 20 3d 20 2f 63 |XDEST. | = /c|
|00001380| 64 34 34 31 2f 61 74 68 | 65 79 2f 62 69 6e 0a 58 |d441/ath|ey/bin.X|
|00001390| 0a 58 4c 49 42 53 09 20 | 20 20 20 20 20 3d 0a 58 |.XLIBS. | =.X|
|000013a0| 0a 58 4c 49 4e 4b 45 52 | 09 20 20 20 20 20 20 3d |.XLINKER|. =|
|000013b0| 20 63 63 0a 58 0a 58 4d | 41 4b 45 46 49 4c 45 20 | cc.X.XM|AKEFILE |
|000013c0| 20 20 20 20 20 3d 20 4d | 61 6b 65 66 69 6c 65 0a | = M|akefile.|
|000013d0| 58 0a 58 4f 42 4a 53 09 | 20 20 20 20 20 20 3d 20 |X.XOBJS.| = |
|000013e0| 63 61 6e 2e 6f 20 72 65 | 63 75 72 63 61 6e 2e 63 |can.o re|curcan.c|
|000013f0| 20 78 64 65 76 63 61 6e | 2e 63 0a 58 0a 58 50 52 | xdevcan|.c.X.XPR|
|00001400| 4f 47 52 41 4d 09 20 20 | 20 20 20 20 3d 20 63 61 |OGRAM. | = ca|
|00001410| 6e 0a 58 0a 58 53 52 43 | 53 09 20 20 20 20 20 20 |n.X.XSRC|S. |
|00001420| 3d 20 63 61 6e 2e 63 0a | 58 0a 58 61 6c 6c 3a 09 |= can.c.|X.Xall:.|
|00001430| 09 24 28 50 52 4f 47 52 | 41 4d 29 0a 58 0a 58 24 |.$(PROGR|AM).X.X$|
|00001440| 28 50 52 4f 47 52 41 4d | 29 3a 20 20 20 20 20 24 |(PROGRAM|): $|
|00001450| 28 4f 42 4a 53 29 20 0a | 58 09 09 24 28 4c 49 4e |(OBJS) .|X..$(LIN|
|00001460| 4b 45 52 29 20 24 28 4f | 42 4a 53 29 20 24 28 4c |KER) $(O|BJS) $(L|
|00001470| 49 42 53 29 20 2d 6f 20 | 24 28 50 52 4f 47 52 41 |IBS) -o |$(PROGRA|
|00001480| 4d 29 0a 58 0a 58 63 6c | 65 61 6e 3a 3b 09 09 72 |M).X.Xcl|ean:;..r|
|00001490| 6d 20 2d 66 20 24 28 4f | 42 4a 53 29 0a 45 4e 44 |m -f $(O|BJS).END|
|000014a0| 5f 4f 46 5f 46 49 4c 45 | 0a 69 66 20 74 65 73 74 |_OF_FILE|.if test|
|000014b0| 20 33 30 37 20 2d 6e 65 | 20 60 77 63 20 2d 63 20 | 307 -ne| `wc -c |
|000014c0| 3c 27 4d 61 6b 65 66 69 | 6c 65 2e 42 53 44 27 60 |<'Makefi|le.BSD'`|
|000014d0| 3b 20 74 68 65 6e 0a 20 | 20 20 20 65 63 68 6f 20 |; then. | echo |
|000014e0| 73 68 61 72 3a 20 5c 22 | 27 4d 61 6b 65 66 69 6c |shar: \"|'Makefil|
|000014f0| 65 2e 42 53 44 27 5c 22 | 20 75 6e 70 61 63 6b 65 |e.BSD'\"| unpacke|
|00001500| 64 20 77 69 74 68 20 77 | 72 6f 6e 67 20 73 69 7a |d with w|rong siz|
|00001510| 65 21 0a 66 69 0a 23 20 | 65 6e 64 20 6f 66 20 27 |e!.fi.# |end of '|
|00001520| 4d 61 6b 65 66 69 6c 65 | 2e 42 53 44 27 0a 66 69 |Makefile|.BSD'.fi|
|00001530| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 4d 61 6b |.if test| -f 'Mak|
|00001540| 65 66 69 6c 65 2e 53 55 | 4e 27 20 2d 61 20 22 24 |efile.SU|N' -a "$|
|00001550| 7b 31 7d 22 20 21 3d 20 | 22 2d 63 22 20 3b 20 74 |{1}" != |"-c" ; t|
|00001560| 68 65 6e 20 0a 20 20 65 | 63 68 6f 20 73 68 61 72 |hen . e|cho shar|
|00001570| 3a 20 57 69 6c 6c 20 6e | 6f 74 20 63 6c 6f 62 62 |: Will n|ot clobb|
|00001580| 65 72 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |er exist|ing file|
|00001590| 20 5c 22 27 4d 61 6b 65 | 66 69 6c 65 2e 53 55 4e | \"'Make|file.SUN|
|000015a0| 27 5c 22 0a 65 6c 73 65 | 0a 65 63 68 6f 20 73 68 |'\".else|.echo sh|
|000015b0| 61 72 3a 20 45 78 74 72 | 61 63 74 69 6e 67 20 5c |ar: Extr|acting \|
|000015c0| 22 27 4d 61 6b 65 66 69 | 6c 65 2e 53 55 4e 27 5c |"'Makefi|le.SUN'\|
|000015d0| 22 20 5c 28 33 30 37 20 | 63 68 61 72 61 63 74 65 |" \(307 |characte|
|000015e0| 72 73 5c 29 0a 73 65 64 | 20 22 73 2f 5e 58 2f 2f |rs\).sed| "s/^X//|
|000015f0| 22 20 3e 27 4d 61 6b 65 | 66 69 6c 65 2e 53 55 4e |" >'Make|file.SUN|
|00001600| 27 20 3c 3c 27 45 4e 44 | 5f 4f 46 5f 46 49 4c 45 |' <<'END|_OF_FILE|
|00001610| 27 0a 58 43 46 4c 41 47 | 53 20 20 20 20 20 20 20 |'.XCFLAG|S |
|00001620| 20 3d 20 2d 4f 20 2d 44 | 53 55 4e 0a 58 0a 58 44 | = -O -D|SUN.X.XD|
|00001630| 45 53 54 09 20 20 20 20 | 20 20 3d 20 2f 63 64 34 |EST. | = /cd4|
|00001640| 34 31 2f 61 74 68 65 79 | 2f 62 69 6e 0a 58 0a 58 |41/athey|/bin.X.X|
|00001650| 4c 49 42 53 09 20 20 20 | 20 20 20 3d 0a 58 0a 58 |LIBS. | =.X.X|
|00001660| 4c 49 4e 4b 45 52 09 20 | 20 20 20 20 20 3d 20 63 |LINKER. | = c|
|00001670| 63 0a 58 0a 58 4d 41 4b | 45 46 49 4c 45 20 20 20 |c.X.XMAK|EFILE |
|00001680| 20 20 20 3d 20 4d 61 6b | 65 66 69 6c 65 0a 58 0a | = Mak|efile.X.|
|00001690| 58 4f 42 4a 53 09 20 20 | 20 20 20 20 3d 20 63 61 |XOBJS. | = ca|
|000016a0| 6e 2e 6f 20 72 65 63 75 | 72 63 61 6e 2e 63 20 78 |n.o recu|rcan.c x|
|000016b0| 64 65 76 63 61 6e 2e 63 | 0a 58 0a 58 50 52 4f 47 |devcan.c|.X.XPROG|
|000016c0| 52 41 4d 09 20 20 20 20 | 20 20 3d 20 63 61 6e 0a |RAM. | = can.|
|000016d0| 58 0a 58 53 52 43 53 09 | 20 20 20 20 20 20 3d 20 |X.XSRCS.| = |
|000016e0| 63 61 6e 2e 63 0a 58 0a | 58 61 6c 6c 3a 09 09 24 |can.c.X.|Xall:..$|
|000016f0| 28 50 52 4f 47 52 41 4d | 29 0a 58 0a 58 24 28 50 |(PROGRAM|).X.X$(P|
|00001700| 52 4f 47 52 41 4d 29 3a | 20 20 20 20 20 24 28 4f |ROGRAM):| $(O|
|00001710| 42 4a 53 29 20 0a 58 09 | 09 24 28 4c 49 4e 4b 45 |BJS) .X.|.$(LINKE|
|00001720| 52 29 20 24 28 4f 42 4a | 53 29 20 24 28 4c 49 42 |R) $(OBJ|S) $(LIB|
|00001730| 53 29 20 2d 6f 20 24 28 | 50 52 4f 47 52 41 4d 29 |S) -o $(|PROGRAM)|
|00001740| 0a 58 0a 58 63 6c 65 61 | 6e 3a 3b 09 09 72 6d 20 |.X.Xclea|n:;..rm |
|00001750| 2d 66 20 24 28 4f 42 4a | 53 29 0a 45 4e 44 5f 4f |-f $(OBJ|S).END_O|
|00001760| 46 5f 46 49 4c 45 0a 69 | 66 20 74 65 73 74 20 33 |F_FILE.i|f test 3|
|00001770| 30 37 20 2d 6e 65 20 60 | 77 63 20 2d 63 20 3c 27 |07 -ne `|wc -c <'|
|00001780| 4d 61 6b 65 66 69 6c 65 | 2e 53 55 4e 27 60 3b 20 |Makefile|.SUN'`; |
|00001790| 74 68 65 6e 0a 20 20 20 | 20 65 63 68 6f 20 73 68 |then. | echo sh|
|000017a0| 61 72 3a 20 5c 22 27 4d | 61 6b 65 66 69 6c 65 2e |ar: \"'M|akefile.|
|000017b0| 53 55 4e 27 5c 22 20 75 | 6e 70 61 63 6b 65 64 20 |SUN'\" u|npacked |
|000017c0| 77 69 74 68 20 77 72 6f | 6e 67 20 73 69 7a 65 21 |with wro|ng size!|
|000017d0| 0a 66 69 0a 23 20 65 6e | 64 20 6f 66 20 27 4d 61 |.fi.# en|d of 'Ma|
|000017e0| 6b 65 66 69 6c 65 2e 53 | 55 4e 27 0a 66 69 0a 69 |kefile.S|UN'.fi.i|
|000017f0| 66 20 74 65 73 74 20 2d | 66 20 27 4d 61 6b 65 66 |f test -|f 'Makef|
|00001800| 69 6c 65 2e 53 59 53 56 | 27 20 2d 61 20 22 24 7b |ile.SYSV|' -a "${|
|00001810| 31 7d 22 20 21 3d 20 22 | 2d 63 22 20 3b 20 74 68 |1}" != "|-c" ; th|
|00001820| 65 6e 20 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |en . ec|ho shar:|
|00001830| 20 57 69 6c 6c 20 6e 6f | 74 20 63 6c 6f 62 62 65 | Will no|t clobbe|
|00001840| 72 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |r existi|ng file |
|00001850| 5c 22 27 4d 61 6b 65 66 | 69 6c 65 2e 53 59 53 56 |\"'Makef|ile.SYSV|
|00001860| 27 5c 22 0a 65 6c 73 65 | 0a 65 63 68 6f 20 73 68 |'\".else|.echo sh|
|00001870| 61 72 3a 20 45 78 74 72 | 61 63 74 69 6e 67 20 5c |ar: Extr|acting \|
|00001880| 22 27 4d 61 6b 65 66 69 | 6c 65 2e 53 59 53 56 27 |"'Makefi|le.SYSV'|
|00001890| 5c 22 20 5c 28 33 32 37 | 20 63 68 61 72 61 63 74 |\" \(327| charact|
|000018a0| 65 72 73 5c 29 0a 73 65 | 64 20 22 73 2f 5e 58 2f |ers\).se|d "s/^X/|
|000018b0| 2f 22 20 3e 27 4d 61 6b | 65 66 69 6c 65 2e 53 59 |/" >'Mak|efile.SY|
|000018c0| 53 56 27 20 3c 3c 27 45 | 4e 44 5f 4f 46 5f 46 49 |SV' <<'E|ND_OF_FI|
|000018d0| 4c 45 27 0a 58 43 46 4c | 41 47 53 20 20 20 20 20 |LE'.XCFL|AGS |
|000018e0| 20 20 20 3d 20 2d 4f 20 | 2d 44 53 59 53 56 0a 58 | = -O |-DSYSV.X|
|000018f0| 0a 58 44 45 53 54 09 20 | 20 20 20 20 20 3d 20 2f |.XDEST. | = /|
|00001900| 63 64 34 34 31 2f 61 74 | 68 65 79 2f 62 69 6e 0a |cd441/at|hey/bin.|
|00001910| 58 0a 58 4c 49 42 53 09 | 20 20 20 20 20 20 3d 20 |X.XLIBS.| = |
|00001920| 2d 6c 6e 64 69 72 20 2d | 6c 6a 6f 62 73 0a 58 0a |-lndir -|ljobs.X.|
|00001930| 58 4c 49 4e 4b 45 52 09 | 20 20 20 20 20 20 3d 20 |XLINKER.| = |
|00001940| 63 63 0a 58 0a 58 4d 41 | 4b 45 46 49 4c 45 20 20 |cc.X.XMA|KEFILE |
|00001950| 20 20 20 20 3d 20 4d 61 | 6b 65 66 69 6c 65 0a 58 | = Ma|kefile.X|
|00001960| 0a 58 4f 42 4a 53 09 20 | 20 20 20 20 20 3d 20 63 |.XOBJS. | = c|
|00001970| 61 6e 2e 6f 20 72 65 63 | 75 72 63 61 6e 2e 6f 20 |an.o rec|urcan.o |
|00001980| 78 64 65 76 63 61 6e 2e | 6f 0a 58 0a 58 50 52 4f |xdevcan.|o.X.XPRO|
|00001990| 47 52 41 4d 09 20 20 20 | 20 20 20 3d 20 63 61 6e |GRAM. | = can|
|000019a0| 0a 58 0a 58 53 52 43 53 | 09 20 20 20 20 20 20 3d |.X.XSRCS|. =|
|000019b0| 20 63 61 6e 2e 63 0a 58 | 0a 58 61 6c 6c 3a 09 09 | can.c.X|.Xall:..|
|000019c0| 24 28 50 52 4f 47 52 41 | 4d 29 0a 58 0a 58 24 28 |$(PROGRA|M).X.X$(|
|000019d0| 50 52 4f 47 52 41 4d 29 | 3a 20 20 20 20 20 24 28 |PROGRAM)|: $(|
|000019e0| 4f 42 4a 53 29 20 63 61 | 6e 2e 68 0a 58 09 09 24 |OBJS) ca|n.h.X..$|
|000019f0| 28 4c 49 4e 4b 45 52 29 | 20 24 28 4f 42 4a 53 29 |(LINKER)| $(OBJS)|
|00001a00| 20 24 28 4c 49 42 53 29 | 20 2d 6f 20 24 28 50 52 | $(LIBS)| -o $(PR|
|00001a10| 4f 47 52 41 4d 29 0a 58 | 0a 58 63 6c 65 61 6e 3a |OGRAM).X|.Xclean:|
|00001a20| 3b 09 09 72 6d 20 2d 66 | 20 24 28 4f 42 4a 53 29 |;..rm -f| $(OBJS)|
|00001a30| 0a 45 4e 44 5f 4f 46 5f | 46 49 4c 45 0a 69 66 20 |.END_OF_|FILE.if |
|00001a40| 74 65 73 74 20 33 32 37 | 20 2d 6e 65 20 60 77 63 |test 327| -ne `wc|
|00001a50| 20 2d 63 20 3c 27 4d 61 | 6b 65 66 69 6c 65 2e 53 | -c <'Ma|kefile.S|
|00001a60| 59 53 56 27 60 3b 20 74 | 68 65 6e 0a 20 20 20 20 |YSV'`; t|hen. |
|00001a70| 65 63 68 6f 20 73 68 61 | 72 3a 20 5c 22 27 4d 61 |echo sha|r: \"'Ma|
|00001a80| 6b 65 66 69 6c 65 2e 53 | 59 53 56 27 5c 22 20 75 |kefile.S|YSV'\" u|
|00001a90| 6e 70 61 63 6b 65 64 20 | 77 69 74 68 20 77 72 6f |npacked |with wro|
|00001aa0| 6e 67 20 73 69 7a 65 21 | 0a 66 69 0a 23 20 65 6e |ng size!|.fi.# en|
|00001ab0| 64 20 6f 66 20 27 4d 61 | 6b 65 66 69 6c 65 2e 53 |d of 'Ma|kefile.S|
|00001ac0| 59 53 56 27 0a 66 69 0a | 69 66 20 74 65 73 74 20 |YSV'.fi.|if test |
|00001ad0| 2d 66 20 27 63 61 6e 2e | 31 27 20 2d 61 20 22 24 |-f 'can.|1' -a "$|
|00001ae0| 7b 31 7d 22 20 21 3d 20 | 22 2d 63 22 20 3b 20 74 |{1}" != |"-c" ; t|
|00001af0| 68 65 6e 20 0a 20 20 65 | 63 68 6f 20 73 68 61 72 |hen . e|cho shar|
|00001b00| 3a 20 57 69 6c 6c 20 6e | 6f 74 20 63 6c 6f 62 62 |: Will n|ot clobb|
|00001b10| 65 72 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |er exist|ing file|
|00001b20| 20 5c 22 27 63 61 6e 2e | 31 27 5c 22 0a 65 6c 73 | \"'can.|1'\".els|
|00001b30| 65 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 45 78 74 |e.echo s|har: Ext|
|00001b40| 72 61 63 74 69 6e 67 20 | 5c 22 27 63 61 6e 2e 31 |racting |\"'can.1|
|00001b50| 27 5c 22 20 5c 28 31 37 | 38 38 20 63 68 61 72 61 |'\" \(17|88 chara|
|00001b60| 63 74 65 72 73 5c 29 0a | 73 65 64 20 22 73 2f 5e |cters\).|sed "s/^|
|00001b70| 58 2f 2f 22 20 3e 27 63 | 61 6e 2e 31 27 20 3c 3c |X//" >'c|an.1' <<|
|00001b80| 27 45 4e 44 5f 4f 46 5f | 46 49 4c 45 27 0a 58 2e |'END_OF_|FILE'.X.|
|00001b90| 5c 22 20 40 28 23 29 72 | 75 6e 2e 31 09 31 30 2e |\" @(#)r|un.1.10.|
|00001ba0| 32 20 28 4d 41 53 53 43 | 4f 4d 50 29 20 38 2f 31 |2 (MASSC|OMP) 8/1|
|00001bb0| 34 2f 38 36 0a 58 2e 52 | 4c 20 22 6c 6f 63 61 6c |4/86.X.R|L "local|
|00001bc0| 22 0a 58 2e 54 48 20 43 | 41 4e 20 31 0a 58 2e 53 |".X.TH C|AN 1.X.S|
|00001bd0| 48 20 4e 41 4d 45 0a 58 | 63 61 6e 20 5c 2d 20 61 |H NAME.X|can \- a|
|00001be0| 20 72 65 70 6c 61 63 65 | 6d 65 6e 74 20 66 6f 72 | replace|ment for|
|00001bf0| 20 72 6d 20 74 68 61 74 | 20 69 73 20 73 61 66 65 | rm that| is safe|
|00001c00| 0a 58 2e 53 48 20 53 59 | 4e 4f 50 53 49 53 0a 58 |.X.SH SY|NOPSIS.X|
|00001c10| 5c 66 42 20 63 61 6e 20 | 5b 20 69 76 6c 72 52 20 |\fB can |[ ivlrR |
|00001c20| 5d 20 3c 66 69 6c 65 20 | 7c 20 64 69 72 65 63 74 |] <file || direct|
|00001c30| 6f 72 79 3e 20 2e 2e 2e | 0a 58 2e 62 72 0a 58 2e |ory> ...|.X.br.X.|
|00001c40| 6e 73 0a 58 2e 53 48 20 | 44 45 53 43 52 49 50 54 |ns.X.SH |DESCRIPT|
|00001c50| 49 4f 4e 0a 58 2e 49 20 | 43 61 6e 0a 58 69 73 20 |ION.X.I |Can.Xis |
|00001c60| 6f 66 74 65 6e 20 61 6e | 20 61 6c 69 61 73 20 6f |often an| alias o|
|00001c70| 66 0a 58 2e 49 20 72 6d | 28 31 29 2e 0a 58 2e 49 |f.X.I rm|(1)..X.I|
|00001c80| 20 43 61 6e 0a 58 77 6f | 72 6b 73 20 73 69 6d 69 | Can.Xwo|rks simi|
|00001c90| 6c 69 61 72 6c 79 2c 20 | 77 69 74 68 20 74 68 65 |liarly, |with the|
|00001ca0| 20 65 78 63 65 70 74 69 | 6f 6e 20 6f 66 20 70 75 | excepti|on of pu|
|00001cb0| 74 74 69 6e 67 20 74 68 | 69 6e 67 73 20 69 6e 74 |tting th|ings int|
|00001cc0| 6f 20 61 20 64 69 72 65 | 63 74 6f 72 79 2c 20 69 |o a dire|ctory, i|
|00001cd0| 6e 0a 58 79 6f 75 72 20 | 68 6f 6d 65 20 64 69 72 |n.Xyour |home dir|
|00001ce0| 65 63 74 6f 72 79 2c 20 | 63 61 6c 6c 65 64 20 22 |ectory, |called "|
|00001cf0| 2e 74 72 61 73 68 63 61 | 6e 2e 22 0a 58 54 68 65 |.trashca|n.".XThe|
|00001d00| 0a 58 2e 42 20 2d 69 0a | 58 6f 70 74 69 6f 6e 20 |.X.B -i.|Xoption |
|00001d10| 6d 61 6b 65 73 20 69 74 | 20 69 6e 74 65 72 61 63 |makes it| interac|
|00001d20| 74 69 76 65 2c 20 71 75 | 65 72 79 69 6e 67 20 66 |tive, qu|erying f|
|00001d30| 6f 72 20 65 61 63 68 20 | 22 63 61 6e 22 2d 69 6e |or each |"can"-in|
|00001d40| 67 2e 0a 58 54 68 65 20 | 0a 58 2e 42 20 2d 76 0a |g..XThe |.X.B -v.|
|00001d50| 58 6f 70 74 69 6f 6e 20 | 67 69 76 65 73 20 61 20 |Xoption |gives a |
|00001d60| 76 65 72 62 6f 73 65 20 | 66 6f 6c 6c 6f 77 69 6e |verbose |followin|
|00001d70| 67 20 6f 66 20 61 6c 6c | 20 61 63 74 69 76 69 74 |g of all| activit|
|00001d80| 69 65 73 20 6f 66 20 74 | 68 69 73 20 63 6f 6d 6d |ies of t|his comm|
|00001d90| 61 6e 64 2e 0a 58 54 68 | 65 0a 58 2e 42 20 2d 6c |and..XTh|e.X.B -l|
|00001da0| 0a 58 6f 70 74 69 6f 6e | 20 77 69 6c 6c 20 67 69 |.Xoption| will gi|
|00001db0| 76 65 20 79 6f 75 20 61 | 20 6c 69 73 74 69 6e 67 |ve you a| listing|
|00001dc0| 20 6f 66 20 74 68 65 20 | 22 24 48 4f 4d 45 2f 2e | of the |"$HOME/.|
|00001dd0| 74 72 61 73 68 63 61 6e | 22 0a 58 64 69 72 65 63 |trashcan|".Xdirec|
|00001de0| 74 6f 72 79 2e 0a 58 54 | 68 65 0a 58 2e 42 20 2d |tory..XT|he.X.B -|
|00001df0| 72 0a 58 6f 70 74 69 6f | 6e 20 77 6f 72 6b 73 20 |r.Xoptio|n works |
|00001e00| 72 65 63 75 72 73 69 76 | 65 6c 79 20 6a 75 73 74 |recursiv|ely just|
|00001e10| 20 74 68 65 20 73 61 6d | 65 20 61 73 20 0a 58 2e | the sam|e as .X.|
|00001e20| 49 20 72 6d 28 31 29 2e | 0a 58 2e 73 70 0a 58 54 |I rm(1).|.X.sp.XT|
|00001e30| 68 65 20 0a 58 2e 42 20 | 2d 52 0a 58 6f 70 74 69 |he .X.B |-R.Xopti|
|00001e40| 6f 6e 20 77 69 6c 6c 20 | 72 65 74 72 69 65 76 65 |on will |retrieve|
|00001e50| 20 61 20 66 69 6c 65 20 | 66 72 6f 6d 20 74 68 65 | a file |from the|
|00001e60| 20 22 24 48 4f 4d 45 2f | 2e 74 72 61 73 68 63 61 | "$HOME/|.trashca|
|00001e70| 6e 22 20 77 69 74 68 6f | 75 74 20 74 68 65 20 68 |n" witho|ut the h|
|00001e80| 61 73 73 6c 65 0a 58 6f | 66 20 6c 6f 6f 6b 69 6e |assle.Xo|f lookin|
|00001e90| 67 20 66 6f 72 20 69 74 | 2e 20 20 54 68 65 0a 58 |g for it|. The.X|
|00001ea0| 2e 42 20 2d 52 0a 58 6f | 70 74 69 6f 6e 20 63 6f |.B -R.Xo|ption co|
|00001eb0| 70 69 65 73 20 74 68 65 | 20 66 69 6c 65 20 66 72 |pies the| file fr|
|00001ec0| 6f 6d 20 74 68 65 20 22 | 24 48 4f 4d 45 2f 2e 74 |om the "|$HOME/.t|
|00001ed0| 72 61 73 68 63 61 6e 22 | 20 64 69 72 65 63 74 6f |rashcan"| directo|
|00001ee0| 72 79 20 69 6e 74 6f 20 | 74 68 65 0a 58 70 72 65 |ry into |the.Xpre|
|00001ef0| 73 65 6e 74 20 77 6f 72 | 6b 69 6e 67 20 64 69 72 |sent wor|king dir|
|00001f00| 65 63 74 6f 72 79 2e 20 | 20 54 68 69 73 20 63 61 |ectory. | This ca|
|00001f10| 6e 20 6f 6e 6c 79 20 72 | 65 63 6f 76 65 72 20 6f |n only r|ecover o|
|00001f20| 6e 65 20 66 69 6c 65 20 | 61 74 20 61 20 74 69 6d |ne file |at a tim|
|00001f30| 65 20 61 6e 64 0a 58 69 | 73 20 74 68 65 20 6f 6e |e and.Xi|s the on|
|00001f40| 6c 79 20 6f 70 74 69 6f | 6e 20 74 68 61 74 20 72 |ly optio|n that r|
|00001f50| 65 71 75 69 72 65 73 20 | 61 6e 20 61 72 67 75 6d |equires |an argum|
|00001f60| 65 6e 74 2e 20 20 59 6f | 75 20 73 68 6f 75 6c 64 |ent. Yo|u should|
|00001f70| 0a 58 6e 6f 74 65 20 74 | 68 61 74 0a 58 2e 42 20 |.Xnote t|hat.X.B |
|00001f80| 2d 52 0a 58 77 69 6c 6c | 20 64 65 73 74 72 6f 79 |-R.Xwill| destroy|
|00001f90| 20 74 68 65 20 66 69 6c | 65 20 69 6e 20 74 68 65 | the fil|e in the|
|00001fa0| 20 77 6f 72 6b 69 6e 67 | 20 64 69 72 65 63 74 6f | working| directo|
|00001fb0| 72 79 20 69 66 20 69 74 | 20 68 61 73 20 74 68 65 |ry if it| has the|
|00001fc0| 20 73 61 6d 65 20 6e 61 | 6d 65 0a 58 61 73 20 74 | same na|me.Xas t|
|00001fd0| 68 65 20 66 69 6c 65 20 | 74 68 61 74 20 69 73 20 |he file |that is |
|00001fe0| 62 65 69 6e 67 20 72 65 | 63 6f 76 65 72 65 64 2c |being re|covered,|
|00001ff0| 20 73 6f 20 75 73 65 20 | 77 69 74 68 20 63 61 75 | so use |with cau|
|00002000| 74 69 6f 6e 2e 0a 58 59 | 6f 75 20 63 61 6e 6e 6f |tion..XY|ou canno|
|00002010| 74 20 75 73 65 20 0a 58 | 2e 42 20 2d 72 0a 58 61 |t use .X|.B -r.Xa|
|00002020| 6e 64 0a 58 2e 42 20 2d | 52 0a 58 69 6e 20 74 68 |nd.X.B -|R.Xin th|
|00002030| 65 20 73 61 6d 65 20 63 | 6f 6d 6d 61 6e 64 20 61 |e same c|ommand a|
|00002040| 6e 64 20 74 68 65 20 66 | 69 6c 65 20 74 6f 20 62 |nd the f|ile to b|
|00002050| 65 20 72 65 63 6f 76 65 | 64 20 6d 75 73 74 20 6e |e recove|d must n|
|00002060| 6f 74 20 68 61 76 65 20 | 61 20 64 69 72 65 63 74 |ot have |a direct|
|00002070| 6f 72 79 0a 58 6e 61 6d | 65 20 69 6e 20 69 74 2e |ory.Xnam|e in it.|
|00002080| 0a 58 2e 73 70 0a 58 54 | 68 65 20 74 72 61 73 68 |.X.sp.XT|he trash|
|00002090| 20 67 65 74 73 20 64 75 | 6d 70 65 64 20 65 76 65 | gets du|mped eve|
|000020a0| 72 79 64 61 79 20 62 75 | 74 20 6f 6e 6c 79 20 67 |ryday bu|t only g|
|000020b0| 65 74 73 20 72 69 64 20 | 6f 66 20 74 68 69 6e 67 |ets rid |of thing|
|000020c0| 73 20 74 68 61 74 0a 58 | 61 72 65 20 6d 6f 72 65 |s that.X|are more|
|000020d0| 20 74 68 61 6e 20 61 20 | 77 65 65 6b 20 6f 6c 64 | than a |week old|
|000020e0| 2e 20 20 49 6e 20 6f 74 | 68 65 72 20 77 6f 72 64 |. In ot|her word|
|000020f0| 73 2c 20 79 6f 75 20 68 | 61 76 65 20 61 20 77 65 |s, you h|ave a we|
|00002100| 65 6b 20 74 6f 20 67 65 | 74 20 73 6f 6d 65 74 68 |ek to ge|t someth|
|00002110| 69 6e 67 0a 58 62 61 63 | 6b 20 61 66 74 65 72 20 |ing.Xbac|k after |
|00002120| 79 6f 75 20 68 61 76 65 | 0a 58 2e 49 20 63 61 6e |you have|.X.I can|
|00002130| 0a 58 08 6e 65 64 20 69 | 74 2e 0a 58 2e 53 48 20 |.X.ned i|t..X.SH |
|00002140| 46 49 4c 45 53 0a 58 2e | 54 50 20 32 2e 35 69 0a |FILES.X.|TP 2.5i.|
|00002150| 58 24 48 4f 4d 45 2f 2e | 74 72 61 73 68 63 61 6e |X$HOME/.|trashcan|
|00002160| 0a 58 54 68 65 20 72 65 | 73 65 72 76 6f 69 72 20 |.XThe re|servoir |
|00002170| 6f 66 20 63 61 6e 6e 65 | 64 20 66 69 6c 65 73 0a |of canne|d files.|
|00002180| 58 2e 53 48 20 53 45 45 | 20 41 4c 53 4f 0a 58 2e |X.SH SEE| ALSO.X.|
|00002190| 49 0a 58 65 6d 70 74 79 | 74 72 61 73 68 28 38 29 |I.Xempty|trash(8)|
|000021a0| 2c 20 72 6d 28 31 29 0a | 58 2e 53 48 20 42 55 47 |, rm(1).|X.SH BUG|
|000021b0| 53 0a 58 54 68 65 20 0a | 58 2e 42 20 2d 52 0a 58 |S.XThe .|X.B -R.X|
|000021c0| 6f 70 74 69 6f 6e 20 64 | 6f 65 73 20 6e 6f 74 20 |option d|oes not |
|000021d0| 77 6f 72 6b 20 6f 6e 20 | 77 69 6c 64 20 63 61 72 |work on |wild car|
|000021e0| 64 73 2e 20 20 59 6f 75 | 20 68 61 76 65 20 74 6f |ds. You| have to|
|000021f0| 20 6b 6e 6f 77 20 74 68 | 65 0a 58 65 78 61 63 74 | know th|e.Xexact|
|00002200| 20 6e 61 6d 65 20 6f 66 | 20 61 20 66 69 6c 65 20 | name of| a file |
|00002210| 69 6e 20 6f 72 64 65 72 | 20 74 6f 20 72 65 63 6f |in order| to reco|
|00002220| 76 65 72 20 69 74 20 77 | 69 74 68 20 74 68 69 73 |ver it w|ith this|
|00002230| 20 63 6f 6d 6d 61 6e 64 | 2e 0a 58 2e 73 70 0a 58 | command|..X.sp.X|
|00002240| 49 66 20 66 75 72 74 68 | 65 72 20 62 75 67 73 20 |If furth|er bugs |
|00002250| 61 72 65 20 66 6f 75 6e | 64 20 70 6c 65 61 73 65 |are foun|d please|
|00002260| 20 72 65 70 6f 72 74 20 | 74 68 65 6d 2e 0a 58 2e | report |them..X.|
|00002270| 53 48 20 41 55 54 48 4f | 52 0a 58 54 68 65 20 42 |SH AUTHO|R.XThe B|
|00002280| 69 74 20 42 75 74 63 68 | 65 72 0a 58 2e 62 72 0a |it Butch|er.X.br.|
|00002290| 58 49 6e 73 70 69 72 65 | 64 20 62 79 20 74 68 65 |XInspire|d by the|
|000022a0| 20 6f 72 69 67 69 6e 61 | 6c 0a 58 2e 42 20 63 61 | origina|l.X.B ca|
|000022b0| 6e 0a 58 77 68 69 63 68 | 20 77 61 73 20 77 72 69 |n.Xwhich| was wri|
|000022c0| 74 74 65 6e 20 62 79 20 | 61 20 52 75 73 73 20 53 |tten by |a Russ S|
|000022d0| 61 67 65 2e 0a 45 4e 44 | 5f 4f 46 5f 46 49 4c 45 |age..END|_OF_FILE|
|000022e0| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 31 20 63 6f |.echo sh|ar: 1 co|
|000022f0| 6e 74 72 6f 6c 20 63 68 | 61 72 61 63 74 65 72 20 |ntrol ch|aracter |
|00002300| 6d 61 79 20 62 65 20 6d | 69 73 73 69 6e 67 20 66 |may be m|issing f|
|00002310| 72 6f 6d 20 5c 22 27 63 | 61 6e 2e 31 27 5c 22 0a |rom \"'c|an.1'\".|
|00002320| 69 66 20 74 65 73 74 20 | 31 37 38 38 20 2d 6e 65 |if test |1788 -ne|
|00002330| 20 60 77 63 20 2d 63 20 | 3c 27 63 61 6e 2e 31 27 | `wc -c |<'can.1'|
|00002340| 60 3b 20 74 68 65 6e 0a | 20 20 20 20 65 63 68 6f |`; then.| echo|
|00002350| 20 73 68 61 72 3a 20 5c | 22 27 63 61 6e 2e 31 27 | shar: \|"'can.1'|
|00002360| 5c 22 20 75 6e 70 61 63 | 6b 65 64 20 77 69 74 68 |\" unpac|ked with|
|00002370| 20 77 72 6f 6e 67 20 73 | 69 7a 65 21 0a 66 69 0a | wrong s|ize!.fi.|
|00002380| 23 20 65 6e 64 20 6f 66 | 20 27 63 61 6e 2e 31 27 |# end of| 'can.1'|
|00002390| 0a 66 69 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |.fi.if t|est -f '|
|000023a0| 63 61 6e 2e 63 27 20 2d | 61 20 22 24 7b 31 7d 22 |can.c' -|a "${1}"|
|000023b0| 20 21 3d 20 22 2d 63 22 | 20 3b 20 74 68 65 6e 20 | != "-c"| ; then |
|000023c0| 0a 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 57 69 |. echo |shar: Wi|
|000023d0| 6c 6c 20 6e 6f 74 20 63 | 6c 6f 62 62 65 72 20 65 |ll not c|lobber e|
|000023e0| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 5c 22 27 |xisting |file \"'|
|000023f0| 63 61 6e 2e 63 27 5c 22 | 0a 65 6c 73 65 0a 65 63 |can.c'\"|.else.ec|
|00002400| 68 6f 20 73 68 61 72 3a | 20 45 78 74 72 61 63 74 |ho shar:| Extract|
|00002410| 69 6e 67 20 5c 22 27 63 | 61 6e 2e 63 27 5c 22 20 |ing \"'c|an.c'\" |
|00002420| 5c 28 36 39 33 32 20 63 | 68 61 72 61 63 74 65 72 |\(6932 c|haracter|
|00002430| 73 5c 29 0a 73 65 64 20 | 22 73 2f 5e 58 2f 2f 22 |s\).sed |"s/^X//"|
|00002440| 20 3e 27 63 61 6e 2e 63 | 27 20 3c 3c 27 45 4e 44 | >'can.c|' <<'END|
|00002450| 5f 4f 46 5f 46 49 4c 45 | 27 0a 58 2f 2a 2a 2a 2a |_OF_FILE|'.X/****|
|00002460| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002470| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002480| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002490| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0a 58 2a 09 63 61 6e |********|*.X*.can|
|000024a0| 2e 63 09 32 2e 30 0a 58 | 2a 0a 58 2a 09 54 68 69 |.c.2.0.X|*.X*.Thi|
|000024b0| 73 20 69 73 20 61 20 75 | 74 69 6c 69 74 79 20 74 |s is a u|tility t|
|000024c0| 6f 20 72 65 70 6c 61 63 | 65 20 72 6d 2e 20 20 49 |o replac|e rm. I|
|000024d0| 20 68 6f 70 65 20 79 6f | 75 20 6c 69 6b 65 20 69 | hope yo|u like i|
|000024e0| 74 0a 58 2a 0a 58 2a 09 | 77 72 69 74 74 65 6e 20 |t.X*.X*.|written |
|000024f0| 62 79 20 22 74 68 65 20 | 62 69 74 20 62 75 74 63 |by "the |bit butc|
|00002500| 68 65 72 22 0a 58 2a 0a | 58 2a 09 32 2e 30 32 20 |her".X*.|X*.2.02 |
|00002510| 63 68 61 6e 67 65 64 20 | 74 68 65 20 65 72 72 6f |changed |the erro|
|00002520| 72 20 68 61 6e 64 6c 69 | 6e 67 20 74 6f 20 63 61 |r handli|ng to ca|
|00002530| 73 65 73 20 61 6e 64 20 | 73 65 67 6d 65 6e 74 65 |ses and |segmente|
|00002540| 64 20 74 68 65 0a 58 2a | 09 09 20 70 72 6f 67 72 |d the.X*|.. progr|
|00002550| 61 6d 20 69 6e 74 6f 20 | 74 68 72 65 65 20 70 69 |am into |three pi|
|00002560| 65 63 65 73 20 61 6e 64 | 20 6e 6f 77 20 68 61 76 |eces and| now hav|
|00002570| 65 20 22 63 61 6e 2e 68 | 22 0a 58 2a 09 09 09 32 |e "can.h|".X*...2|
|00002580| 38 20 4a 75 6e 65 20 31 | 39 38 38 0a 58 2a 0a 58 |8 June 1|988.X*.X|
|00002590| 2a 09 32 2e 30 31 20 63 | 68 61 6e 67 65 64 20 74 |*.2.01 c|hanged t|
|000025a0| 68 65 20 77 61 79 20 63 | 72 6f 73 73 20 64 65 76 |he way c|ross dev|
|000025b0| 69 63 65 20 70 72 6f 62 | 6c 65 6d 73 20 61 72 65 |ice prob|lems are|
|000025c0| 20 64 65 61 6c 74 20 77 | 69 74 68 0a 58 2a 20 20 | dealt w|ith.X* |
|000025d0| 20 20 20 20 20 20 63 6f | 70 79 20 66 69 6c 65 20 | co|py file |
|000025e0| 66 72 6f 6d 20 6f 6e 65 | 20 73 79 73 74 65 6d 20 |from one| system |
|000025f0| 74 6f 20 74 68 65 20 6f | 74 68 65 72 0a 58 2a 09 |to the o|ther.X*.|
|00002600| 09 09 62 65 66 6f 72 65 | 20 32 38 20 4a 75 6e 65 |..before| 28 June|
|00002610| 20 31 39 38 38 0a 58 2a | 2a 2a 2a 2a 2a 2a 2a 2a | 1988.X*|********|
|00002620| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002630| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002640| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002650| 2a 2a 2a 2a 2f 0a 58 0a | 58 23 69 6e 63 6c 75 64 |****/.X.|X#includ|
|00002660| 65 20 22 63 61 6e 2e 68 | 22 0a 58 0a 58 63 68 61 |e "can.h|".X.Xcha|
|00002670| 72 20 43 41 4e 5b 4d 41 | 58 50 41 54 48 4c 45 4e |r CAN[MA|XPATHLEN|
|00002680| 5d 3b 09 2f 2a 20 53 74 | 72 69 6e 67 20 63 6f 6e |];./* St|ring con|
|00002690| 74 61 69 6e 69 6e 67 20 | 2e 74 72 61 73 68 63 61 |taining |.trashca|
|000026a0| 6e 20 64 69 72 65 63 74 | 6f 72 79 2a 2f 09 0a 58 |n direct|ory*/..X|
|000026b0| 63 68 61 72 20 41 4e 53 | 57 45 52 5b 31 34 5d 3b |char ANS|WER[14];|
|000026c0| 09 09 2f 2a 20 53 74 72 | 69 6e 67 20 75 73 65 64 |../* Str|ing used|
|000026d0| 20 66 6f 72 20 66 69 6e | 64 69 6e 67 20 69 6e 74 | for fin|ding int|
|000026e0| 65 72 61 63 74 69 76 65 | 20 72 65 73 70 6f 6e 73 |eractive| respons|
|000026f0| 65 20 2a 2f 0a 58 69 6e | 74 20 56 45 52 42 4f 53 |e */.Xin|t VERBOS|
|00002700| 45 20 3d 20 30 3b 09 09 | 09 2f 2a 20 53 65 74 20 |E = 0;..|./* Set |
|00002710| 69 66 20 56 65 72 62 6f | 73 65 20 69 73 20 77 61 |if Verbo|se is wa|
|00002720| 6e 74 65 64 20 2a 2f 0a | 58 69 6e 74 20 49 4e 54 |nted */.|Xint INT|
|00002730| 45 52 41 43 54 49 56 45 | 20 3d 20 30 3b 09 09 09 |ERACTIVE| = 0;...|
|00002740| 2f 2a 20 53 65 74 20 69 | 66 20 49 6e 74 65 72 61 |/* Set i|f Intera|
|00002750| 63 74 69 76 65 20 69 73 | 20 77 61 6e 74 65 64 20 |ctive is| wanted |
|00002760| 2a 2f 0a 58 6c 6f 6e 67 | 20 54 49 4d 45 3b 09 09 |*/.Xlong| TIME;..|
|00002770| 2f 2a 20 55 73 65 64 20 | 74 6f 20 67 65 74 20 74 |/* Used |to get t|
|00002780| 68 65 20 63 75 72 72 65 | 6e 74 20 74 69 6d 65 20 |he curre|nt time |
|00002790| 2a 2f 0a 58 55 54 49 4d | 42 55 46 20 54 49 4d 45 |*/.XUTIM|BUF TIME|
|000027a0| 53 3b 09 2f 2a 20 53 74 | 72 75 63 74 75 72 65 20 |S;./* St|ructure |
|000027b0| 75 73 65 64 20 74 6f 20 | 63 68 61 6e 67 65 20 74 |used to |change t|
|000027c0| 68 65 20 61 63 63 65 73 | 73 20 74 69 6d 65 20 2a |he acces|s time *|
|000027d0| 2f 0a 58 0a 58 6d 61 69 | 6e 28 61 72 67 63 2c 20 |/.X.Xmai|n(argc, |
|000027e0| 61 72 67 76 29 0a 58 69 | 6e 74 20 61 72 67 63 3b |argv).Xi|nt argc;|
|000027f0| 0a 58 63 68 61 72 2a 2a | 20 61 72 67 76 3b 0a 58 |.Xchar**| argv;.X|
|00002800| 7b 0a 58 09 69 6e 74 20 | 63 3b 09 09 09 09 09 09 |{.X.int |c;......|
|00002810| 2f 2a 20 77 68 69 63 68 | 20 63 68 61 72 61 63 74 |/* which| charact|
|00002820| 65 72 20 69 6e 20 67 65 | 74 6f 70 74 20 2a 2f 0a |er in ge|topt */.|
|00002830| 58 09 44 49 52 20 2a 44 | 49 52 50 3b 09 09 2f 2a |X.DIR *D|IRP;../*|
|00002840| 20 55 73 65 64 20 74 6f | 20 6c 69 73 74 20 74 68 | Used to| list th|
|00002850| 65 20 64 69 72 65 63 74 | 6f 72 79 20 62 79 20 70 |e direct|ory by p|
|00002860| 6f 69 6e 74 69 6e 67 20 | 61 74 20 2e 74 72 61 73 |ointing |at .tras|
|00002870| 68 63 61 6e 20 2a 2f 0a | 58 09 73 74 72 75 63 74 |hcan */.|X.struct|
|00002880| 20 64 69 72 65 63 74 20 | 2a 44 50 3b 09 2f 2a 20 | direct |*DP;./* |
|00002890| 55 73 65 64 20 74 6f 20 | 70 6f 69 6e 74 20 61 74 |Used to |point at|
|000028a0| 20 63 6f 6e 73 65 63 75 | 74 69 76 65 20 65 6e 74 | consecu|tive ent|
|000028b0| 72 69 65 73 20 77 68 65 | 6e 20 6c 69 73 74 69 6e |ries whe|n listin|
|000028c0| 67 20 2a 2f 0a 58 09 63 | 68 61 72 20 46 49 4c 45 |g */.X.c|har FILE|
|000028d0| 4e 41 4d 45 5b 4d 41 58 | 50 41 54 48 4c 45 4e 5d |NAME[MAX|PATHLEN]|
|000028e0| 3b 09 2f 2a 20 53 74 72 | 69 6e 67 20 63 6f 6e 74 |;./* Str|ing cont|
|000028f0| 61 69 6e 69 6e 67 20 2e | 74 72 61 73 68 63 61 6e |aining .|trashcan|
|00002900| 2f 63 75 72 72 65 6e 74 | 20 66 69 6c 65 2a 2f 09 |/current| file*/.|
|00002910| 0a 58 09 63 68 61 72 20 | 2a 41 43 54 4e 41 4d 45 |.X.char |*ACTNAME|
|00002920| 3b 09 09 2f 2a 20 50 6f | 69 6e 74 73 20 74 6f 20 |;../* Po|ints to |
|00002930| 66 69 6c 65 6e 61 6d 65 | 20 77 69 74 68 6f 75 74 |filename| without|
|00002940| 20 61 6e 79 20 6c 65 61 | 64 69 6e 67 20 64 69 72 | any lea|ding dir|
|00002950| 65 63 74 6f 72 79 20 2a | 2f 0a 58 09 73 74 72 75 |ectory *|/.X.stru|
|00002960| 63 74 20 73 74 61 74 20 | 42 55 46 3b 09 2f 2a 20 |ct stat |BUF;./* |
|00002970| 55 73 65 64 20 74 6f 20 | 70 6f 69 6e 74 20 74 6f |Used to |point to|
|00002980| 20 6d 6f 64 65 20 69 6e | 66 6f 20 61 62 6f 75 74 | mode in|fo about|
|00002990| 20 66 69 6c 65 73 20 2a | 2f 0a 58 09 69 6e 74 20 | files *|/.X.int |
|000029a0| 52 45 43 55 52 53 49 56 | 45 20 3d 20 30 3b 09 09 |RECURSIV|E = 0;..|
|000029b0| 09 2f 2a 20 53 65 74 20 | 69 66 20 52 65 63 75 72 |./* Set |if Recur|
|000029c0| 73 69 76 65 20 69 73 20 | 77 61 6e 74 65 64 20 2a |sive is |wanted *|
|000029d0| 2f 0a 58 23 69 66 64 65 | 66 20 53 59 53 56 0a 58 |/.X#ifde|f SYSV.X|
|000029e0| 09 69 6e 74 20 55 49 44 | 3b 09 2f 2a 20 56 61 72 |.int UID|;./* Var|
|000029f0| 69 61 62 6c 65 20 68 6f | 6c 64 69 6e 67 20 75 73 |iable ho|lding us|
|00002a00| 65 72 27 73 20 49 44 20 | 2a 2f 0a 58 23 65 6e 64 |er's ID |*/.X#end|
|00002a10| 69 66 0a 58 23 69 66 64 | 65 66 20 53 55 4e 0a 58 |if.X#ifd|ef SUN.X|
|00002a20| 09 69 6e 74 20 55 49 44 | 3b 09 2f 2a 20 56 61 72 |.int UID|;./* Var|
|00002a30| 69 61 62 6c 65 20 68 6f | 6c 64 69 6e 67 20 75 73 |iable ho|lding us|
|00002a40| 65 72 27 73 20 49 44 20 | 2a 2f 0a 58 23 65 6e 64 |er's ID |*/.X#end|
|00002a50| 69 66 0a 58 23 69 66 64 | 65 66 20 42 53 44 0a 58 |if.X#ifd|ef BSD.X|
|00002a60| 09 75 69 64 5f 74 20 55 | 49 44 3b 09 2f 2a 20 56 |.uid_t U|ID;./* V|
|00002a70| 61 72 69 61 62 6c 65 20 | 68 6f 6c 64 69 6e 67 20 |ariable |holding |
|00002a80| 75 73 65 72 27 73 20 49 | 44 20 2a 2f 0a 58 23 65 |user's I|D */.X#e|
|00002a90| 6e 64 69 66 0a 58 09 63 | 68 61 72 20 54 45 4d 50 |ndif.X.c|har TEMP|
|00002aa0| 5b 4d 41 58 50 41 54 48 | 4c 45 4e 5d 3b 09 2f 2a |[MAXPATH|LEN];./*|
|00002ab0| 20 55 73 65 64 20 66 6f | 72 20 71 75 69 63 6b 20 | Used fo|r quick |
|00002ac0| 61 63 63 65 73 73 20 6f | 66 20 66 69 6c 65 20 6e |access o|f file n|
|00002ad0| 61 6d 65 73 20 2a 2f 0a | 58 09 73 74 72 75 63 74 |ames */.|X.struct|
|00002ae0| 20 70 61 73 73 77 64 20 | 2a 55 53 45 52 49 4e 46 | passwd |*USERINF|
|00002af0| 4f 3b 09 2f 2a 20 53 74 | 72 75 63 74 75 72 65 20 |O;./* St|ructure |
|00002b00| 75 73 65 64 20 74 6f 20 | 66 69 6e 64 20 6f 75 74 |used to |find out|
|00002b10| 20 24 48 4f 4d 45 20 64 | 69 72 20 2a 2f 0a 58 09 | $HOME d|ir */.X.|
|00002b20| 65 78 74 65 72 6e 20 69 | 6e 74 20 6f 70 74 69 6e |extern i|nt optin|
|00002b30| 64 3b 09 2f 2a 20 75 73 | 65 64 20 74 6f 20 73 74 |d;./* us|ed to st|
|00002b40| 65 70 20 74 68 72 6f 75 | 67 68 20 61 72 67 75 6d |ep throu|gh argum|
|00002b50| 65 6e 74 73 20 2a 2f 0a | 58 09 65 78 74 65 72 6e |ents */.|X.extern|
|00002b60| 20 63 68 61 72 20 2a 6f | 70 74 61 72 67 3b 09 2f | char *o|ptarg;./|
|00002b70| 2a 20 75 73 65 64 20 74 | 6f 20 73 74 65 70 20 74 |* used t|o step t|
|00002b80| 68 72 6f 75 67 68 20 61 | 72 67 75 6d 65 6e 74 73 |hrough a|rguments|
|00002b90| 20 2a 2f 0a 58 09 69 6e | 74 09 65 72 72 66 6c 61 | */.X.in|t.errfla|
|00002ba0| 67 20 3d 20 30 3b 09 2f | 2a 20 55 73 65 64 20 74 |g = 0;./|* Used t|
|00002bb0| 6f 20 69 6e 64 69 63 61 | 74 65 20 65 72 72 6f 72 |o indica|te error|
|00002bc0| 73 20 69 6e 20 6f 70 74 | 69 6f 6e 73 20 2a 2f 0a |s in opt|ions */.|
|00002bd0| 58 09 76 6f 69 64 20 72 | 65 63 75 72 63 61 6e 28 |X.void r|ecurcan(|
|00002be0| 29 3b 09 2f 2a 20 53 61 | 79 20 74 68 69 73 20 69 |);./* Sa|y this i|
|00002bf0| 73 20 61 20 76 6f 69 64 | 20 66 75 6e 63 74 69 6f |s a void| functio|
|00002c00| 6e 20 2a 2f 0a 58 0a 58 | 09 2f 2a 20 46 69 6e 64 |n */.X.X|./* Find|
|00002c10| 20 6f 75 74 20 74 68 65 | 20 75 73 65 72 73 20 49 | out the| users I|
|00002c20| 44 20 2a 2f 0a 58 09 69 | 66 28 28 55 49 44 3d 20 |D */.X.i|f((UID= |
|00002c30| 67 65 74 75 69 64 28 29 | 29 20 3d 3d 20 4e 55 4c |getuid()|) == NUL|
|00002c40| 4c 29 0a 58 09 7b 0a 58 | 09 09 66 70 72 69 6e 74 |L).X.{.X|..fprint|
|00002c50| 66 28 73 74 64 65 72 72 | 2c 20 22 49 6e 76 61 6c |f(stderr|, "Inval|
|00002c60| 69 64 20 4c 6f 67 69 6e | 3a 20 57 68 6f 20 41 72 |id Login|: Who Ar|
|00002c70| 65 20 59 6f 75 21 3f 21 | 5c 6e 22 29 3b 0a 58 09 |e You!?!|\n");.X.|
|00002c80| 09 65 78 69 74 28 30 29 | 3b 0a 58 09 7d 0a 58 0a |.exit(0)|;.X.}.X.|
|00002c90| 58 09 2f 2a 20 47 65 74 | 20 68 69 73 20 68 6f 6d |X./* Get| his hom|
|00002ca0| 65 20 64 69 72 65 63 74 | 6f 72 79 20 66 72 6f 6d |e direct|ory from|
|00002cb0| 20 74 68 65 20 70 61 73 | 73 77 64 20 66 69 6c 65 | the pas|swd file|
|00002cc0| 20 2a 2f 0a 58 09 55 53 | 45 52 49 4e 46 4f 20 3d | */.X.US|ERINFO =|
|00002cd0| 20 67 65 74 70 77 75 69 | 64 28 55 49 44 29 3b 0a | getpwui|d(UID);.|
|00002ce0| 58 09 69 66 28 55 53 45 | 52 49 4e 46 4f 2d 3e 70 |X.if(USE|RINFO->p|
|00002cf0| 77 5f 64 69 72 20 3d 3d | 20 4e 55 4c 4c 29 0a 58 |w_dir ==| NULL).X|
|00002d00| 09 7b 0a 58 09 09 66 70 | 72 69 6e 74 66 28 73 74 |.{.X..fp|rintf(st|
|00002d10| 64 65 72 72 2c 20 22 4e | 6f 20 48 6f 6d 65 20 44 |derr, "N|o Home D|
|00002d20| 69 72 65 63 74 6f 72 79 | 3a 20 63 68 65 63 6b 20 |irectory|: check |
|00002d30| 2f 65 74 63 2f 70 61 73 | 73 77 64 20 21 21 21 5c |/etc/pas|swd !!!\|
|00002d40| 6e 22 29 3b 0a 58 09 09 | 65 78 69 74 28 30 29 3b |n");.X..|exit(0);|
|00002d50| 0a 58 09 7d 0a 58 09 2f | 2a 20 20 73 61 79 20 77 |.X.}.X./|* say w|
|00002d60| 68 65 72 65 20 74 68 65 | 20 74 72 61 73 68 63 61 |here the| trashca|
|00002d70| 6e 20 77 69 6c 6c 20 62 | 65 20 2a 2f 0a 58 09 73 |n will b|e */.X.s|
|00002d80| 70 72 69 6e 74 66 28 43 | 41 4e 2c 20 22 25 73 2f |printf(C|AN, "%s/|
|00002d90| 2e 74 72 61 73 68 63 61 | 6e 22 2c 20 55 53 45 52 |.trashca|n", USER|
|00002da0| 49 4e 46 4f 2d 3e 70 77 | 5f 64 69 72 29 3b 0a 58 |INFO->pw|_dir);.X|
|00002db0| 0a 58 09 2f 2a 20 6d 61 | 6b 65 20 73 75 72 65 20 |.X./* ma|ke sure |
|00002dc0| 74 68 65 72 65 20 69 73 | 20 61 20 74 72 61 73 68 |there is| a trash|
|00002dd0| 63 61 6e 20 2a 2f 0a 58 | 09 69 66 20 28 61 63 63 |can */.X|.if (acc|
|00002de0| 65 73 73 28 43 41 4e 2c | 20 46 5f 4f 4b 29 20 21 |ess(CAN,| F_OK) !|
|00002df0| 3d 20 30 29 0a 58 09 09 | 2f 2a 20 69 66 20 6e 6f |= 0).X..|/* if no|
|00002e00| 74 2c 20 6d 61 6b 65 20 | 61 20 74 72 61 73 68 63 |t, make |a trashc|
|00002e10| 61 6e 20 2a 2f 0a 58 09 | 09 69 66 28 6d 6b 64 69 |an */.X.|.if(mkdi|
|00002e20| 72 28 43 41 4e 2c 20 30 | 30 34 37 37 37 29 20 21 |r(CAN, 0|04777) !|
|00002e30| 3d 20 30 29 0a 58 09 09 | 7b 0a 58 09 09 09 70 65 |= 0).X..|{.X...pe|
|00002e40| 72 72 6f 72 28 22 63 61 | 6e 22 29 3b 0a 58 09 09 |rror("ca|n");.X..|
|00002e50| 09 65 78 69 74 28 32 29 | 3b 0a 58 09 09 7d 0a 58 |.exit(2)|;.X..}.X|
|00002e60| 0a 58 09 2f 2a 20 63 6f | 75 6c 64 20 61 64 64 20 |.X./* co|uld add |
|00002e70| 66 6f 72 63 65 20 28 2d | 66 29 20 6f 70 74 69 6f |force (-|f) optio|
|00002e80| 6e 20 6c 61 74 65 72 2c | 20 70 65 72 68 61 70 73 |n later,| perhaps|
|00002e90| 20 2a 2f 0a 58 09 2f 2a | 20 4c 65 74 27 73 20 6c | */.X./*| Let's l|
|00002ea0| 6f 6f 6b 20 61 74 20 74 | 68 65 20 6f 70 74 69 6f |ook at t|he optio|
|00002eb0| 6e 73 20 2a 2f 0a 58 09 | 77 68 69 6c 65 28 28 63 |ns */.X.|while((c|
|00002ec0| 3d 67 65 74 6f 70 74 28 | 61 72 67 63 2c 20 61 72 |=getopt(|argc, ar|
|00002ed0| 67 76 2c 20 22 69 76 6c | 52 3a 72 22 29 29 20 21 |gv, "ivl|R:r")) !|
|00002ee0| 3d 20 45 4f 46 29 0a 58 | 09 09 73 77 69 74 63 68 |= EOF).X|..switch|
|00002ef0| 28 63 29 0a 58 09 09 7b | 0a 58 09 09 09 63 61 73 |(c).X..{|.X...cas|
|00002f00| 65 20 27 6c 27 3a 09 2f | 2a 20 6c 69 73 74 20 74 |e 'l':./|* list t|
|00002f10| 68 65 20 63 6f 6e 74 65 | 6e 74 73 20 62 79 20 73 |he conte|nts by s|
|00002f20| 74 65 70 70 69 6e 67 20 | 74 68 72 6f 75 67 68 20 |tepping |through |
|00002f30| 2a 2f 0a 58 09 09 09 09 | 66 70 72 69 6e 74 66 28 |*/.X....|fprintf(|
|00002f40| 73 74 64 6f 75 74 2c 20 | 22 25 73 5c 6e 22 2c 20 |stdout, |"%s\n", |
|00002f50| 43 41 4e 29 3b 0a 58 09 | 09 09 09 44 49 52 50 20 |CAN);.X.|...DIRP |
|00002f60| 3d 20 6f 70 65 6e 64 69 | 72 28 43 41 4e 29 3b 0a |= opendi|r(CAN);.|
|00002f70| 58 09 09 2f 2a 20 43 6f | 75 6c 64 20 61 6c 6c 6f |X../* Co|uld allo|
|00002f80| 77 20 61 72 67 75 6d 65 | 6e 74 73 20 66 6f 72 20 |w argume|nts for |
|00002f90| 73 65 6c 65 63 74 69 76 | 65 20 6c 69 73 74 69 6e |selectiv|e listin|
|00002fa0| 67 20 2a 2f 0a 58 09 09 | 09 09 66 6f 72 28 44 50 |g */.X..|..for(DP|
|00002fb0| 20 3d 20 72 65 61 64 64 | 69 72 28 44 49 52 50 29 | = readd|ir(DIRP)|
|00002fc0| 3b 20 44 50 20 21 3d 20 | 4e 55 4c 4c 3b 20 44 50 |; DP != |NULL; DP|
|00002fd0| 3d 20 72 65 61 64 64 69 | 72 28 44 49 52 50 29 29 |= readdi|r(DIRP))|
|00002fe0| 0a 58 09 09 09 09 09 66 | 70 72 69 6e 74 66 28 73 |.X.....f|printf(s|
|00002ff0| 74 64 6f 75 74 2c 20 22 | 25 73 5c 6e 22 2c 20 44 |tdout, "|%s\n", D|
|00003000| 50 2d 3e 64 5f 6e 61 6d | 65 29 3b 0a 58 09 09 09 |P->d_nam|e);.X...|
|00003010| 09 63 6c 6f 73 65 64 69 | 72 28 44 49 52 50 29 3b |.closedi|r(DIRP);|
|00003020| 0a 58 09 09 09 09 65 78 | 69 74 28 30 29 3b 0a 58 |.X....ex|it(0);.X|
|00003030| 09 09 09 09 62 72 65 61 | 6b 3b 0a 58 09 09 09 63 |....brea|k;.X...c|
|00003040| 61 73 65 20 27 76 27 3a | 09 2f 2a 20 53 65 74 20 |ase 'v':|./* Set |
|00003050| 74 68 65 20 76 65 72 62 | 6f 73 65 20 6d 6f 64 65 |the verb|ose mode|
|00003060| 20 2a 2f 0a 58 09 09 09 | 09 56 45 52 42 4f 53 45 | */.X...|.VERBOSE|
|00003070| 2b 2b 3b 0a 58 09 09 09 | 09 62 72 65 61 6b 3b 0a |++;.X...|.break;.|
|00003080| 58 09 09 09 63 61 73 65 | 20 27 69 27 3a 09 2f 2a |X...case| 'i':./*|
|00003090| 20 53 65 74 20 74 68 65 | 20 69 6e 74 65 72 61 63 | Set the| interac|
|000030a0| 74 69 76 65 20 6d 6f 64 | 65 20 2a 2f 0a 58 09 09 |tive mod|e */.X..|
|000030b0| 09 09 49 4e 54 45 52 41 | 43 54 49 56 45 2b 2b 3b |..INTERA|CTIVE++;|
|000030c0| 0a 58 09 09 09 09 62 72 | 65 61 6b 3b 0a 58 09 09 |.X....br|eak;.X..|
|000030d0| 09 63 61 73 65 20 27 52 | 27 3a 09 2f 2a 20 52 65 |.case 'R|':./* Re|
|000030e0| 63 6f 76 65 72 20 61 20 | 66 69 6c 65 20 2a 2f 0a |cover a |file */.|
|000030f0| 58 09 09 09 09 69 66 28 | 52 45 43 55 52 53 49 56 |X....if(|RECURSIV|
|00003100| 45 29 09 2f 2a 20 69 66 | 20 72 65 63 75 72 73 69 |E)./* if| recursi|
|00003110| 76 65 20 70 6f 69 6e 74 | 20 6f 75 74 20 69 6c 6c |ve point| out ill|
|00003120| 65 67 61 6c 20 6f 70 74 | 69 6f 6e 20 0a 58 09 09 |egal opt|ion .X..|
|00003130| 09 09 09 09 09 09 63 6f | 6d 62 69 6e 61 74 69 6f |......co|mbinatio|
|00003140| 6e 20 2a 2f 0a 58 09 09 | 09 09 7b 0a 58 09 09 09 |n */.X..|..{.X...|
|00003150| 09 09 65 72 72 66 6c 61 | 67 2b 2b 3b 0a 58 09 09 |..errfla|g++;.X..|
|00003160| 09 09 09 62 72 65 61 6b | 3b 0a 58 09 09 09 09 7d |...break|;.X....}|
|00003170| 0a 58 09 09 09 09 2f 2a | 20 67 65 74 20 6e 61 6d |.X..../*| get nam|
|00003180| 65 20 6f 66 20 66 69 6c | 65 20 74 6f 20 72 65 63 |e of fil|e to rec|
|00003190| 6f 76 65 72 20 2a 2f 0a | 58 09 09 09 09 73 74 72 |over */.|X....str|
|000031a0| 63 70 79 28 54 45 4d 50 | 2c 20 6f 70 74 61 72 67 |cpy(TEMP|, optarg|
|000031b0| 29 3b 0a 58 09 09 09 09 | 2f 2a 20 64 6f 65 73 20 |);.X....|/* does |
|000031c0| 69 74 20 68 61 76 65 20 | 61 20 64 69 72 65 63 74 |it have |a direct|
|000031d0| 6f 72 79 20 69 6e 20 69 | 74 73 20 6e 61 6d 65 20 |ory in i|ts name |
|000031e0| 3f 20 28 69 74 20 73 68 | 6f 75 6c 64 20 6e 6f 74 |? (it sh|ould not|
|000031f0| 29 20 2a 2f 0a 58 09 09 | 09 09 69 66 28 28 41 43 |) */.X..|..if((AC|
|00003200| 54 4e 41 4d 45 20 3d 20 | 73 74 72 72 63 68 72 28 |TNAME = |strrchr(|
|00003210| 54 45 4d 50 2c 20 27 2f | 27 29 29 20 21 3d 20 4e |TEMP, '/|')) != N|
|00003220| 55 4c 4c 29 0a 58 09 09 | 09 09 7b 0a 58 09 09 09 |ULL).X..|..{.X...|
|00003230| 09 09 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |..fprint|f(stderr|
|00003240| 2c 20 22 63 61 6e 3a 20 | 63 61 6e 6e 6f 74 20 61 |, "can: |cannot a|
|00003250| 63 63 65 73 73 20 25 73 | 5c 6e 22 2c 20 54 45 4d |ccess %s|\n", TEM|
|00003260| 50 29 3b 0a 58 09 09 09 | 09 09 66 70 72 69 6e 74 |P);.X...|..fprint|
|00003270| 66 28 73 74 64 65 72 72 | 2c 20 22 20 20 20 20 6e |f(stderr|, " n|
|00003280| 6f 20 64 69 72 65 63 74 | 6f 72 79 20 6e 61 6d 65 |o direct|ory name|
|00003290| 73 20 69 6e 20 52 65 63 | 6f 76 65 72 79 5c 6e 22 |s in Rec|overy\n"|
|000032a0| 29 3b 0a 58 09 09 09 09 | 09 63 6f 6e 74 69 6e 75 |);.X....|.continu|
|000032b0| 65 3b 0a 58 09 09 09 09 | 7d 0a 58 09 09 09 09 65 |e;.X....|}.X....e|
|000032c0| 6c 73 65 0a 58 09 09 09 | 09 09 2f 2a 20 6e 61 6d |lse.X...|../* nam|
|000032d0| 65 20 74 68 65 20 61 63 | 74 75 61 6c 20 66 69 6c |e the ac|tual fil|
|000032e0| 65 20 69 6e 20 74 68 65 | 20 74 72 61 73 68 63 61 |e in the| trashca|
|000032f0| 6e 20 74 6f 20 67 65 74 | 20 2a 2f 0a 58 09 09 09 |n to get| */.X...|
|00003300| 09 09 73 70 72 69 6e 74 | 66 28 46 49 4c 45 4e 41 |..sprint|f(FILENA|
|00003310| 4d 45 2c 20 22 25 73 2f | 25 73 22 2c 20 43 41 4e |ME, "%s/|%s", CAN|
|00003320| 2c 20 54 45 4d 50 29 3b | 0a 58 09 09 09 09 2f 2a |, TEMP);|.X..../*|
|00003330| 20 64 6f 65 73 20 69 74 | 20 65 78 69 73 74 20 69 | does it| exist i|
|00003340| 6e 20 74 68 65 20 74 72 | 61 73 68 63 61 6e 20 2a |n the tr|ashcan *|
|00003350| 2f 0a 58 09 09 09 09 69 | 66 28 61 63 63 65 73 73 |/.X....i|f(access|
|00003360| 28 46 49 4c 45 4e 41 4d | 45 2c 20 46 5f 4f 4b 29 |(FILENAM|E, F_OK)|
|00003370| 20 21 3d 20 30 29 0a 58 | 09 09 09 09 7b 0a 58 09 | != 0).X|....{.X.|
|00003380| 09 09 09 09 66 70 72 69 | 6e 74 66 28 73 74 64 65 |....fpri|ntf(stde|
|00003390| 72 72 2c 20 22 63 61 6e | 3a 20 25 73 20 64 6f 65 |rr, "can|: %s doe|
|000033a0| 73 20 6e 6f 74 20 65 78 | 69 73 74 5c 6e 22 2c 20 |s not ex|ist\n", |
|000033b0| 54 45 4d 50 29 3b 0a 58 | 09 09 09 09 09 63 6f 6e |TEMP);.X|.....con|
|000033c0| 74 69 6e 75 65 3b 0a 58 | 09 09 09 09 7d 0a 58 09 |tinue;.X|....}.X.|
|000033d0| 09 09 09 2f 2a 20 69 6e | 74 65 72 6f 67 61 74 65 |.../* in|terogate|
|000033e0| 20 6a 75 73 74 20 69 6e | 20 63 61 73 65 20 2a 2f | just in| case */|
|000033f0| 0a 58 09 09 09 09 69 66 | 20 28 49 4e 54 45 52 41 |.X....if| (INTERA|
|00003400| 43 54 49 56 45 29 0a 58 | 09 09 09 09 7b 0a 58 09 |CTIVE).X|....{.X.|
|00003410| 09 09 09 09 66 70 72 69 | 6e 74 66 28 73 74 64 6f |....fpri|ntf(stdo|
|00003420| 75 74 2c 20 22 63 61 6e | 20 72 65 63 6f 76 65 72 |ut, "can| recover|
|00003430| 3a 20 25 73 5c 3f 20 22 | 2c 20 54 45 4d 50 29 3b |: %s\? "|, TEMP);|
|00003440| 0a 58 09 09 09 09 09 66 | 73 63 61 6e 66 28 73 74 |.X.....f|scanf(st|
|00003450| 64 69 6e 2c 20 22 25 73 | 22 2c 20 41 4e 53 57 45 |din, "%s|", ANSWE|
|00003460| 52 29 3b 0a 58 09 09 09 | 09 09 69 66 20 28 28 41 |R);.X...|..if ((A|
|00003470| 4e 53 57 45 52 5b 30 5d | 20 21 3d 20 27 79 27 29 |NSWER[0]| != 'y')|
|00003480| 20 26 26 20 28 41 4e 53 | 57 45 52 5b 30 5d 20 21 | && (ANS|WER[0] !|
|00003490| 3d 20 27 59 27 29 29 0a | 58 09 09 09 09 09 09 63 |= 'Y')).|X......c|
|000034a0| 6f 6e 74 69 6e 75 65 3b | 0a 58 09 09 09 09 7d 0a |ontinue;|.X....}.|
|000034b0| 58 09 09 09 09 2f 2a 20 | 67 65 74 20 72 69 64 20 |X..../* |get rid |
|000034c0| 6f 66 20 66 69 6c 65 20 | 69 66 20 69 74 20 65 78 |of file |if it ex|
|000034d0| 69 73 74 73 20 69 6e 20 | 63 75 72 72 65 6e 74 20 |ists in |current |
|000034e0| 64 69 72 65 63 74 6f 72 | 79 20 2a 2f 0a 58 09 09 |director|y */.X..|
|000034f0| 09 09 69 66 20 28 61 63 | 63 65 73 73 28 54 45 4d |..if (ac|cess(TEM|
|00003500| 50 2c 20 46 5f 4f 4b 29 | 20 3d 3d 20 30 29 0a 58 |P, F_OK)| == 0).X|
|00003510| 09 09 09 09 09 69 66 20 | 28 75 6e 6c 69 6e 6b 28 |.....if |(unlink(|
|00003520| 54 45 4d 50 29 20 21 3d | 20 30 29 0a 58 09 09 09 |TEMP) !=| 0).X...|
|00003530| 09 09 7b 0a 58 09 09 09 | 09 09 09 70 65 72 72 6f |..{.X...|...perro|
|00003540| 72 28 22 63 61 6e 22 29 | 3b 0a 58 09 09 09 09 09 |r("can")|;.X.....|
|00003550| 09 63 6f 6e 74 69 6e 75 | 65 3b 0a 58 09 09 09 09 |.continu|e;.X....|
|00003560| 09 7d 0a 58 09 09 09 09 | 2f 2a 20 67 65 74 20 61 |.}.X....|/* get a|
|00003570| 20 6e 65 77 20 63 6f 70 | 79 20 6f 66 20 74 68 65 | new cop|y of the|
|00003580| 20 66 69 6c 65 20 69 6e | 74 6f 20 74 68 65 20 77 | file in|to the w|
|00003590| 6f 72 6b 69 6e 67 20 64 | 69 72 65 63 74 6f 72 79 |orking d|irectory|
|000035a0| 20 2a 2f 0a 58 09 09 09 | 09 69 66 20 28 6c 69 6e | */.X...|.if (lin|
|000035b0| 6b 28 46 49 4c 45 4e 41 | 4d 45 2c 20 54 45 4d 50 |k(FILENA|ME, TEMP|
|000035c0| 29 20 21 3d 20 30 29 0a | 58 09 09 09 09 7b 0a 58 |) != 0).|X....{.X|
|000035d0| 09 09 09 09 09 70 65 72 | 72 6f 72 28 22 63 61 6e |.....per|ror("can|
|000035e0| 22 29 3b 0a 58 09 09 09 | 09 09 63 6f 6e 74 69 6e |");.X...|..contin|
|000035f0| 75 65 3b 0a 58 09 09 09 | 09 7d 0a 58 09 09 09 09 |ue;.X...|.}.X....|
|00003600| 2f 2a 20 73 61 79 20 69 | 74 20 68 61 73 20 62 65 |/* say i|t has be|
|00003610| 65 6e 20 72 65 63 79 63 | 6c 65 64 20 2a 2f 0a 58 |en recyc|led */.X|
|00003620| 09 09 09 09 66 70 72 69 | 6e 74 66 28 73 74 64 6f |....fpri|ntf(stdo|
|00003630| 75 74 2c 20 22 25 73 3a | 20 72 65 63 6f 76 65 72 |ut, "%s:| recover|
|00003640| 65 64 5c 6e 22 2c 20 54 | 45 4d 50 29 3b 0a 58 09 |ed\n", T|EMP);.X.|
|00003650| 09 09 09 65 78 69 74 28 | 30 29 3b 0a 58 09 09 09 |...exit(|0);.X...|
|00003660| 09 62 72 65 61 6b 3b 0a | 58 09 09 09 63 61 73 65 |.break;.|X...case|
|00003670| 20 27 72 27 3a 09 2f 2a | 20 4c 65 74 27 73 20 67 | 'r':./*| Let's g|
|00003680| 65 74 20 72 65 63 75 72 | 73 69 76 65 20 2a 2f 0a |et recur|sive */.|
|00003690| 58 09 09 09 09 52 45 43 | 55 52 53 49 56 45 2b 2b |X....REC|URSIVE++|
|000036a0| 3b 0a 58 09 09 09 09 62 | 72 65 61 6b 3b 0a 58 09 |;.X....b|reak;.X.|
|000036b0| 09 09 64 65 66 61 75 6c | 74 3a 09 2f 2a 20 45 72 |..defaul|t:./* Er|
|000036c0| 72 6f 72 73 20 69 6e 20 | 62 61 64 20 6f 70 74 69 |rors in |bad opti|
|000036d0| 6f 6e 73 20 2a 2f 0a 58 | 09 09 09 09 65 72 72 66 |ons */.X|....errf|
|000036e0| 6c 61 67 2b 2b 3b 0a 58 | 09 09 09 09 62 72 65 61 |lag++;.X|....brea|
|000036f0| 6b 3b 0a 58 09 09 7d 0a | 58 0a 58 09 09 2f 2a 20 |k;.X..}.|X.X../* |
|00003700| 73 61 79 20 69 66 20 74 | 68 65 72 65 20 61 72 65 |say if t|here are|
|00003710| 20 73 6f 6d 65 20 62 61 | 64 20 6f 70 74 69 6f 6e | some ba|d option|
|00003720| 73 20 2a 2f 0a 58 09 09 | 69 66 28 65 72 72 66 6c |s */.X..|if(errfl|
|00003730| 61 67 29 0a 58 09 09 7b | 0a 58 09 09 09 66 70 72 |ag).X..{|.X...fpr|
|00003740| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 20 22 25 73 |intf(std|err, "%s|
|00003750| 5c 6e 22 2c 20 55 53 41 | 47 45 29 3b 0a 58 09 09 |\n", USA|GE);.X..|
|00003760| 09 65 78 69 74 28 32 29 | 3b 0a 58 09 09 7d 0a 58 |.exit(2)|;.X..}.X|
|00003770| 0a 58 09 09 2f 2a 20 67 | 65 74 20 74 68 65 20 63 |.X../* g|et the c|
|00003780| 75 72 72 65 6e 74 20 74 | 69 6d 65 20 2a 2f 0a 58 |urrent t|ime */.X|
|00003790| 09 09 69 66 28 28 54 49 | 4d 45 20 3d 74 69 6d 65 |..if((TI|ME =time|
|000037a0| 28 30 29 29 20 3d 3d 20 | 30 29 0a 58 09 09 7b 0a |(0)) == |0).X..{.|
|000037b0| 58 09 09 09 70 65 72 72 | 6f 72 28 22 63 61 6e 22 |X...perr|or("can"|
|000037c0| 29 3b 0a 58 09 09 09 65 | 78 69 74 28 32 29 3b 0a |);.X...e|xit(2);.|
|000037d0| 58 09 09 7d 0a 58 09 09 | 2f 2a 20 73 74 65 70 20 |X..}.X..|/* step |
|000037e0| 74 68 72 6f 75 67 68 20 | 74 68 65 20 61 72 67 75 |through |the argu|
|000037f0| 6d 65 6e 74 73 20 74 6f | 20 73 65 65 20 77 68 61 |ments to| see wha|
|00003800| 74 20 74 6f 20 67 65 74 | 20 72 69 64 20 6f 66 20 |t to get| rid of |
|00003810| 2a 2f 0a 58 09 09 66 6f | 72 28 20 3b 20 6f 70 74 |*/.X..fo|r( ; opt|
|00003820| 69 6e 64 20 3c 20 61 72 | 67 63 3b 20 6f 70 74 69 |ind < ar|gc; opti|
|00003830| 6e 64 2b 2b 29 0a 58 09 | 09 7b 0a 58 09 09 09 73 |nd++).X.|.{.X...s|
|00003840| 74 72 63 70 79 28 54 45 | 4d 50 2c 20 61 72 67 76 |trcpy(TE|MP, argv|
|00003850| 5b 6f 70 74 69 6e 64 5d | 29 3b 09 2f 2a 20 67 65 |[optind]|);./* ge|
|00003860| 74 20 74 68 65 20 6e 65 | 78 74 20 61 72 67 75 6d |t the ne|xt argum|
|00003870| 65 6e 74 20 2a 2f 0a 58 | 09 09 09 73 74 61 74 28 |ent */.X|...stat(|
|00003880| 54 45 4d 50 2c 20 26 42 | 55 46 29 3b 09 2f 2a 20 |TEMP, &B|UF);./* |
|00003890| 67 65 74 20 66 69 6c 65 | 20 69 6e 66 6f 20 61 62 |get file| info ab|
|000038a0| 6f 75 74 20 74 68 69 73 | 20 66 69 6c 65 20 2a 2f |out this| file */|
|000038b0| 0a 58 09 09 09 2f 2a 20 | 43 68 65 63 6b 20 66 6f |.X.../* |Check fo|
|000038c0| 72 20 74 68 65 20 65 78 | 69 73 74 65 6e 63 65 20 |r the ex|istence |
|000038d0| 6f 66 20 61 20 66 69 6c | 65 20 74 68 61 74 20 69 |of a fil|e that i|
|000038e0| 73 20 6e 6f 74 20 61 20 | 64 69 72 65 63 74 6f 72 |s not a |director|
|000038f0| 79 20 2a 2f 0a 58 09 09 | 09 69 66 20 28 28 61 63 |y */.X..|.if ((ac|
|00003900| 63 65 73 73 28 54 45 4d | 50 2c 20 46 5f 4f 4b 29 |cess(TEM|P, F_OK)|
|00003910| 20 3d 3d 20 30 29 20 26 | 26 20 28 21 28 42 55 46 | == 0) &|& (!(BUF|
|00003920| 2e 73 74 5f 6d 6f 64 65 | 20 26 20 30 30 34 30 30 |.st_mode| & 00400|
|00003930| 30 30 29 29 29 0a 58 09 | 09 09 7b 0a 58 09 09 09 |00))).X.|..{.X...|
|00003940| 09 2f 2a 20 69 6e 74 65 | 72 6f 67 61 74 65 20 2a |./* inte|rogate *|
|00003950| 2f 0a 58 09 09 09 09 69 | 66 28 49 4e 54 45 52 41 |/.X....i|f(INTERA|
|00003960| 43 54 49 56 45 20 21 3d | 20 30 29 0a 58 09 09 09 |CTIVE !=| 0).X...|
|00003970| 09 7b 0a 58 09 09 09 09 | 09 66 70 72 69 6e 74 66 |.{.X....|.fprintf|
|00003980| 28 73 74 64 6f 75 74 2c | 20 22 63 61 6e 20 25 73 |(stdout,| "can %s|
|00003990| 5c 3f 20 22 2c 20 54 45 | 4d 50 29 3b 0a 58 09 09 |\? ", TE|MP);.X..|
|000039a0| 09 09 09 66 73 63 61 6e | 66 28 73 74 64 69 6e 2c |...fscan|f(stdin,|
|000039b0| 20 22 25 73 22 2c 20 41 | 4e 53 57 45 52 29 3b 0a | "%s", A|NSWER);.|
|000039c0| 58 09 09 09 09 09 69 66 | 28 28 41 4e 53 57 45 52 |X.....if|((ANSWER|
|000039d0| 5b 30 5d 20 21 3d 20 27 | 79 27 29 20 26 26 20 28 |[0] != '|y') && (|
|000039e0| 41 4e 53 57 45 52 5b 30 | 5d 20 21 3d 20 27 59 27 |ANSWER[0|] != 'Y'|
|000039f0| 29 29 0a 58 09 09 09 09 | 09 09 63 6f 6e 74 69 6e |)).X....|..contin|
|00003a00| 75 65 3b 0a 58 09 09 09 | 09 7d 0a 58 09 09 09 09 |ue;.X...|.}.X....|
|00003a10| 2f 2a 20 73 74 72 69 70 | 20 6f 66 66 20 64 69 72 |/* strip| off dir|
|00003a20| 65 63 74 6f 72 79 20 6e | 61 6d 65 73 20 73 6f 20 |ectory n|ames so |
|00003a30| 77 65 20 63 61 6e 20 74 | 72 61 73 68 20 69 74 20 |we can t|rash it |
|00003a40| 70 72 6f 70 65 72 6c 79 | 20 2a 2f 0a 58 09 09 09 |properly| */.X...|
|00003a50| 09 69 66 28 28 41 43 54 | 4e 41 4d 45 20 3d 20 73 |.if((ACT|NAME = s|
|00003a60| 74 72 72 63 68 72 28 54 | 45 4d 50 2c 20 27 2f 27 |trrchr(T|EMP, '/'|
|00003a70| 29 29 20 21 3d 20 4e 55 | 4c 4c 29 0a 58 09 09 09 |)) != NU|LL).X...|
|00003a80| 09 09 73 70 72 69 6e 74 | 66 28 46 49 4c 45 4e 41 |..sprint|f(FILENA|
|00003a90| 4d 45 2c 20 22 25 73 25 | 73 22 2c 20 43 41 4e 2c |ME, "%s%|s", CAN,|
|00003aa0| 20 41 43 54 4e 41 4d 45 | 29 3b 0a 58 09 09 09 09 | ACTNAME|);.X....|
|00003ab0| 65 6c 73 65 0a 58 09 09 | 09 09 09 73 70 72 69 6e |else.X..|...sprin|
|00003ac0| 74 66 28 46 49 4c 45 4e | 41 4d 45 2c 20 22 25 73 |tf(FILEN|AME, "%s|
|00003ad0| 2f 25 73 22 2c 20 43 41 | 4e 2c 20 54 45 4d 50 29 |/%s", CA|N, TEMP)|
|00003ae0| 3b 0a 58 09 09 09 09 2f | 2a 20 69 66 20 69 74 20 |;.X..../|* if it |
|00003af0| 65 78 69 73 74 73 20 69 | 6e 20 74 68 65 20 74 72 |exists i|n the tr|
|00003b00| 61 73 68 63 61 6e 20 61 | 6c 72 65 61 64 79 20 67 |ashcan a|lready g|
|00003b10| 65 74 20 72 69 64 20 6f | 66 20 69 74 20 2a 2f 0a |et rid o|f it */.|
|00003b20| 58 09 09 09 09 69 66 20 | 28 61 63 63 65 73 73 28 |X....if |(access(|
|00003b30| 46 49 4c 45 4e 41 4d 45 | 2c 20 46 5f 4f 4b 29 20 |FILENAME|, F_OK) |
|00003b40| 3d 3d 20 30 29 0a 58 09 | 09 09 09 09 69 66 28 75 |== 0).X.|....if(u|
|00003b50| 6e 6c 69 6e 6b 28 46 49 | 4c 45 4e 41 4d 45 29 20 |nlink(FI|LENAME) |
|00003b60| 21 3d 20 30 29 0a 58 09 | 09 09 09 09 7b 0a 58 09 |!= 0).X.|....{.X.|
|00003b70| 09 09 09 09 09 70 65 72 | 72 6f 72 28 22 63 61 6e |.....per|ror("can|
|00003b80| 33 22 29 3b 0a 58 09 09 | 09 09 09 09 63 6f 6e 74 |3");.X..|....cont|
|00003b90| 69 6e 75 65 3b 0a 58 09 | 09 09 09 09 7d 0a 58 09 |inue;.X.|....}.X.|
|00003ba0| 09 09 09 2f 2a 20 70 75 | 74 20 69 74 20 69 6e 20 |.../* pu|t it in |
|00003bb0| 74 68 65 20 74 72 61 73 | 68 63 61 6e 20 2a 2f 0a |the tras|hcan */.|
|00003bc0| 58 09 09 09 09 69 66 28 | 6c 69 6e 6b 28 54 45 4d |X....if(|link(TEM|
|00003bd0| 50 2c 20 46 49 4c 45 4e | 41 4d 45 29 20 21 3d 20 |P, FILEN|AME) != |
|00003be0| 30 29 0a 58 09 09 09 09 | 7b 0a 58 09 09 09 09 09 |0).X....|{.X.....|
|00003bf0| 73 77 69 74 63 68 28 65 | 72 72 6e 6f 29 0a 58 09 |switch(e|rrno).X.|
|00003c00| 09 09 09 09 7b 0a 58 09 | 09 09 09 09 09 63 61 73 |....{.X.|.....cas|
|00003c10| 65 20 45 58 44 45 56 3a | 0a 58 09 09 09 09 09 09 |e EXDEV:|.X......|
|00003c20| 09 63 72 6f 73 73 64 65 | 76 63 61 6e 28 54 45 4d |.crossde|vcan(TEM|
|00003c30| 50 2c 20 46 49 4c 45 4e | 41 4d 45 29 3b 0a 58 09 |P, FILEN|AME);.X.|
|00003c40| 09 09 09 09 09 09 62 72 | 65 61 6b 3b 0a 58 09 09 |......br|eak;.X..|
|00003c50| 09 09 09 09 64 65 66 61 | 75 6c 74 3a 0a 58 09 09 |....defa|ult:.X..|
|00003c60| 09 09 09 09 09 70 65 72 | 72 6f 72 28 22 63 61 6e |.....per|ror("can|
|00003c70| 31 22 29 3b 0a 58 09 09 | 09 09 09 09 09 63 6f 6e |1");.X..|.....con|
|00003c80| 74 69 6e 75 65 3b 0a 58 | 09 09 09 09 09 7d 0a 58 |tinue;.X|.....}.X|
|00003c90| 09 09 09 09 7d 0a 58 09 | 09 09 09 2f 2a 20 67 65 |....}.X.|.../* ge|
|00003ca0| 74 20 72 69 64 20 6f 66 | 20 74 68 65 20 6f 72 69 |t rid of| the ori|
|00003cb0| 67 69 6e 61 6c 20 2a 2f | 0a 58 09 09 09 09 69 66 |ginal */|.X....if|
|00003cc0| 28 75 6e 6c 69 6e 6b 28 | 54 45 4d 50 29 20 21 3d |(unlink(|TEMP) !=|
|00003cd0| 20 30 29 0a 58 09 09 09 | 09 7b 0a 58 09 09 09 09 | 0).X...|.{.X....|
|00003ce0| 09 70 65 72 72 6f 72 28 | 22 63 61 6e 34 22 29 3b |.perror(|"can4");|
|00003cf0| 0a 58 09 09 09 09 09 63 | 6f 6e 74 69 6e 75 65 3b |.X.....c|ontinue;|
|00003d00| 0a 58 09 09 09 09 7d 0a | 58 09 09 09 09 2f 2a 20 |.X....}.|X..../* |
|00003d10| 63 68 61 6e 67 65 20 74 | 68 65 20 61 63 63 65 73 |change t|he acces|
|00003d20| 73 20 74 69 6d 65 20 2a | 2f 0a 58 09 09 09 09 54 |s time *|/.X....T|
|00003d30| 49 4d 45 53 2e 61 63 74 | 69 6d 65 3d 20 28 74 69 |IMES.act|ime= (ti|
|00003d40| 6d 65 5f 74 29 54 49 4d | 45 3b 0a 58 09 09 09 09 |me_t)TIM|E;.X....|
|00003d50| 54 49 4d 45 53 2e 6d 6f | 64 74 69 6d 65 3d 20 42 |TIMES.mo|dtime= B|
|00003d60| 55 46 2e 73 74 5f 6d 74 | 69 6d 65 3b 0a 58 09 09 |UF.st_mt|ime;.X..|
|00003d70| 09 09 69 66 28 75 74 69 | 6d 65 28 46 49 4c 45 4e |..if(uti|me(FILEN|
|00003d80| 41 4d 45 2c 20 26 54 49 | 4d 45 53 29 20 21 3d 20 |AME, &TI|MES) != |
|00003d90| 30 29 0a 58 09 09 09 09 | 7b 0a 58 09 09 09 09 09 |0).X....|{.X.....|
|00003da0| 70 65 72 72 6f 72 28 22 | 63 61 6e 35 22 29 3b 0a |perror("|can5");.|
|00003db0| 58 09 09 09 09 09 63 6f | 6e 74 69 6e 75 65 3b 0a |X.....co|ntinue;.|
|00003dc0| 58 09 09 09 09 7d 0a 58 | 09 09 09 09 2f 2a 20 74 |X....}.X|..../* t|
|00003dd0| 65 6c 6c 20 74 68 65 6d | 20 77 68 61 74 20 77 65 |ell them| what we|
|00003de0| 20 64 69 64 20 69 66 20 | 74 68 65 79 20 77 61 6e | did if |they wan|
|00003df0| 74 20 74 6f 20 6b 6e 6f | 77 20 2a 2f 0a 58 09 09 |t to kno|w */.X..|
|00003e00| 09 09 69 66 28 56 45 52 | 42 4f 53 45 29 0a 58 09 |..if(VER|BOSE).X.|
|00003e10| 09 09 09 09 66 70 72 69 | 6e 74 66 28 73 74 64 6f |....fpri|ntf(stdo|
|00003e20| 75 74 2c 20 22 25 73 3a | 20 63 61 6e 6e 65 64 5c |ut, "%s:| canned\|
|00003e30| 6e 22 2c 20 54 45 4d 50 | 29 3b 0a 58 09 09 09 7d |n", TEMP|);.X...}|
|00003e40| 0a 58 09 09 09 65 6c 73 | 65 0a 58 09 09 09 7b 0a |.X...els|e.X...{.|
|00003e50| 58 09 09 09 09 2f 2a 20 | 69 73 20 74 68 69 73 20 |X..../* |is this |
|00003e60| 61 20 64 69 72 65 63 74 | 6f 72 79 3f 20 2a 2f 0a |a direct|ory? */.|
|00003e70| 58 09 09 09 09 69 66 28 | 42 55 46 2e 73 74 5f 6d |X....if(|BUF.st_m|
|00003e80| 6f 64 65 20 26 20 30 30 | 34 30 30 30 30 29 0a 58 |ode & 00|40000).X|
|00003e90| 09 09 09 09 7b 0a 58 09 | 09 09 09 09 69 66 28 52 |....{.X.|....if(R|
|00003ea0| 45 43 55 52 53 49 56 45 | 20 3d 3d 20 30 29 20 2f |ECURSIVE| == 0) /|
|00003eb0| 2a 20 79 65 73 2c 20 74 | 68 65 6e 20 64 6f 20 72 |* yes, t|hen do r|
|00003ec0| 65 63 75 72 73 69 6f 6e | 20 69 66 20 4f 4b 20 2a |ecursion| if OK *|
|00003ed0| 2f 0a 58 09 09 09 09 09 | 09 66 70 72 69 6e 74 66 |/.X.....|.fprintf|
|00003ee0| 28 73 74 64 65 72 72 2c | 20 22 63 61 6e 6e 6f 74 |(stderr,| "cannot|
|00003ef0| 20 63 61 6e 3a 20 25 73 | 20 64 69 72 65 63 74 6f | can: %s| directo|
|00003f00| 72 79 5c 6e 22 2c 20 54 | 45 4d 50 29 3b 0a 58 09 |ry\n", T|EMP);.X.|
|00003f10| 09 09 09 09 65 6c 73 65 | 0a 58 09 09 09 09 09 7b |....else|.X.....{|
|00003f20| 0a 58 09 09 09 09 09 09 | 69 66 28 49 4e 54 45 52 |.X......|if(INTER|
|00003f30| 41 43 54 49 56 45 20 21 | 3d 20 30 29 0a 58 09 09 |ACTIVE !|= 0).X..|
|00003f40| 09 09 09 09 7b 0a 58 09 | 09 09 09 09 09 09 66 70 |....{.X.|......fp|
|00003f50| 72 69 6e 74 66 28 73 74 | 64 6f 75 74 2c 20 22 63 |rintf(st|dout, "c|
|00003f60| 61 6e 20 63 68 65 63 6b | 20 25 73 20 64 69 72 65 |an check| %s dire|
|00003f70| 63 74 6f 72 79 5c 3f 20 | 22 2c 20 54 45 4d 50 29 |ctory\? |", TEMP)|
|00003f80| 3b 0a 58 09 09 09 09 09 | 09 09 66 73 63 61 6e 66 |;.X.....|..fscanf|
|00003f90| 28 73 74 64 69 6e 2c 20 | 22 25 73 22 2c 20 41 4e |(stdin, |"%s", AN|
|00003fa0| 53 57 45 52 29 3b 0a 58 | 09 09 09 09 09 09 09 69 |SWER);.X|.......i|
|00003fb0| 66 28 28 41 4e 53 57 45 | 52 5b 30 5d 20 21 3d 20 |f((ANSWE|R[0] != |
|00003fc0| 27 79 27 29 20 26 26 20 | 28 41 4e 53 57 45 52 5b |'y') && |(ANSWER[|
|00003fd0| 30 5d 20 21 3d 20 27 59 | 27 29 29 0a 58 09 09 09 |0] != 'Y|')).X...|
|00003fe0| 09 09 09 09 09 63 6f 6e | 74 69 6e 75 65 3b 0a 58 |.....con|tinue;.X|
|00003ff0| 09 09 09 09 09 09 7d 0a | 58 09 09 09 09 09 09 72 |......}.|X......r|
|00004000| 65 63 75 72 63 61 6e 28 | 54 45 4d 50 29 3b 0a 58 |ecurcan(|TEMP);.X|
|00004010| 09 09 09 09 09 7d 0a 58 | 09 09 09 09 7d 0a 58 09 |.....}.X|....}.X.|
|00004020| 09 09 09 65 6c 73 65 09 | 2f 2a 20 74 68 65 20 66 |...else.|/* the f|
|00004030| 69 6c 65 20 64 6f 65 73 | 20 6e 6f 74 20 65 78 69 |ile does| not exi|
|00004040| 73 74 20 2a 2f 0a 58 09 | 09 09 09 09 70 65 72 72 |st */.X.|....perr|
|00004050| 6f 72 28 22 63 61 6e 36 | 22 29 3b 0a 58 09 09 09 |or("can6|");.X...|
|00004060| 7d 0a 58 09 09 7d 0a 58 | 7d 0a 45 4e 44 5f 4f 46 |}.X..}.X|}.END_OF|
|00004070| 5f 46 49 4c 45 0a 69 66 | 20 74 65 73 74 20 36 39 |_FILE.if| test 69|
|00004080| 33 32 20 2d 6e 65 20 60 | 77 63 20 2d 63 20 3c 27 |32 -ne `|wc -c <'|
|00004090| 63 61 6e 2e 63 27 60 3b | 20 74 68 65 6e 0a 20 20 |can.c'`;| then. |
|000040a0| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 5c 22 27 | echo s|har: \"'|
|000040b0| 63 61 6e 2e 63 27 5c 22 | 20 75 6e 70 61 63 6b 65 |can.c'\"| unpacke|
|000040c0| 64 20 77 69 74 68 20 77 | 72 6f 6e 67 20 73 69 7a |d with w|rong siz|
|000040d0| 65 21 0a 66 69 0a 23 20 | 65 6e 64 20 6f 66 20 27 |e!.fi.# |end of '|
|000040e0| 63 61 6e 2e 63 27 0a 66 | 69 0a 69 66 20 74 65 73 |can.c'.f|i.if tes|
|000040f0| 74 20 2d 66 20 27 63 61 | 6e 2e 68 27 20 2d 61 20 |t -f 'ca|n.h' -a |
|00004100| 22 24 7b 31 7d 22 20 21 | 3d 20 22 2d 63 22 20 3b |"${1}" !|= "-c" ;|
|00004110| 20 74 68 65 6e 20 0a 20 | 20 65 63 68 6f 20 73 68 | then . | echo sh|
|00004120| 61 72 3a 20 57 69 6c 6c | 20 6e 6f 74 20 63 6c 6f |ar: Will| not clo|
|00004130| 62 62 65 72 20 65 78 69 | 73 74 69 6e 67 20 66 69 |bber exi|sting fi|
|00004140| 6c 65 20 5c 22 27 63 61 | 6e 2e 68 27 5c 22 0a 65 |le \"'ca|n.h'\".e|
|00004150| 6c 73 65 0a 65 63 68 6f | 20 73 68 61 72 3a 20 45 |lse.echo| shar: E|
|00004160| 78 74 72 61 63 74 69 6e | 67 20 5c 22 27 63 61 6e |xtractin|g \"'can|
|00004170| 2e 68 27 5c 22 20 5c 28 | 31 30 39 36 20 63 68 61 |.h'\" \(|1096 cha|
|00004180| 72 61 63 74 65 72 73 5c | 29 0a 73 65 64 20 22 73 |racters\|).sed "s|
|00004190| 2f 5e 58 2f 2f 22 20 3e | 27 63 61 6e 2e 68 27 20 |/^X//" >|'can.h' |
|000041a0| 3c 3c 27 45 4e 44 5f 4f | 46 5f 46 49 4c 45 27 0a |<<'END_O|F_FILE'.|
|000041b0| 58 2f 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |X/******|********|
|000041c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000041d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000041e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000041f0| 2a 2a 2a 2a 0a 58 2a 0a | 58 2a 09 43 41 4e 2e 48 |****.X*.|X*.CAN.H|
|00004200| 0a 58 2a 0a 58 2a 0a 58 | 2a 0a 58 2a 2a 2a 2a 2a |.X*.X*.X|*.X*****|
|00004210| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004220| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004230| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004240| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2f 0a 58 |********|*****/.X|
|00004250| 0a 58 23 69 6e 63 6c 75 | 64 65 20 3c 73 74 64 69 |.X#inclu|de <stdi|
|00004260| 6f 2e 68 3e 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |o.h>.X#i|nclude <|
|00004270| 70 77 64 2e 68 3e 0a 58 | 23 69 6e 63 6c 75 64 65 |pwd.h>.X|#include|
|00004280| 20 3c 73 74 72 69 6e 67 | 2e 68 3e 0a 58 23 69 6e | <string|.h>.X#in|
|00004290| 63 6c 75 64 65 20 3c 65 | 72 72 6e 6f 2e 68 3e 0a |clude <e|rrno.h>.|
|000042a0| 58 23 69 6e 63 6c 75 64 | 65 20 3c 66 63 6e 74 6c |X#includ|e <fcntl|
|000042b0| 2e 68 3e 0a 58 23 69 6e | 63 6c 75 64 65 20 3c 73 |.h>.X#in|clude <s|
|000042c0| 79 73 2f 74 79 70 65 73 | 2e 68 3e 0a 58 23 69 6e |ys/types|.h>.X#in|
|000042d0| 63 6c 75 64 65 20 3c 73 | 79 73 2f 74 69 6d 65 62 |clude <s|ys/timeb|
|000042e0| 2e 68 3e 0a 58 23 69 6e | 63 6c 75 64 65 20 3c 73 |.h>.X#in|clude <s|
|000042f0| 79 73 2f 66 69 6c 65 2e | 68 3e 0a 58 23 69 6e 63 |ys/file.|h>.X#inc|
|00004300| 6c 75 64 65 20 3c 73 79 | 73 2f 73 74 61 74 2e 68 |lude <sy|s/stat.h|
|00004310| 3e 0a 58 0a 58 23 69 66 | 64 65 66 20 53 59 53 56 |>.X.X#if|def SYSV|
|00004320| 0a 58 23 69 6e 63 6c 75 | 64 65 20 3c 6e 64 69 72 |.X#inclu|de <ndir|
|00004330| 2e 68 3e 0a 58 23 65 6e | 64 69 66 0a 58 0a 58 23 |.h>.X#en|dif.X.X#|
|00004340| 69 66 64 65 66 20 53 55 | 4e 0a 58 23 69 6e 63 6c |ifdef SU|N.X#incl|
|00004350| 75 64 65 20 3c 73 79 73 | 2f 64 69 72 2e 68 3e 0a |ude <sys|/dir.h>.|
|00004360| 58 23 65 6e 64 69 66 0a | 58 0a 58 23 69 66 64 65 |X#endif.|X.X#ifde|
|00004370| 66 20 42 53 44 0a 58 23 | 69 6e 63 6c 75 64 65 20 |f BSD.X#|include |
|00004380| 3c 73 79 73 2f 64 69 72 | 2e 68 3e 0a 58 23 65 6e |<sys/dir|.h>.X#en|
|00004390| 64 69 66 0a 58 0a 58 23 | 64 65 66 69 6e 65 20 55 |dif.X.X#|define U|
|000043a0| 53 41 47 45 20 22 75 73 | 61 67 65 3a 20 63 61 6e |SAGE "us|age: can|
|000043b0| 20 5b 69 76 6c 72 52 5d | 20 66 69 6c 65 20 2e 2e | [ivlrR]| file ..|
|000043c0| 2e 22 0a 58 23 64 65 66 | 69 6e 65 20 4d 41 58 50 |.".X#def|ine MAXP|
|000043d0| 41 54 48 4c 45 4e 20 38 | 30 09 2f 2a 20 4c 6f 6e |ATHLEN 8|0./* Lon|
|000043e0| 67 65 73 74 20 70 6f 73 | 73 69 62 6c 65 20 70 61 |gest pos|sible pa|
|000043f0| 74 68 20 6e 61 6d 65 20 | 2a 2f 0a 58 0a 58 65 78 |th name |*/.X.Xex|
|00004400| 74 65 72 6e 20 63 68 61 | 72 20 43 41 4e 5b 5d 3b |tern cha|r CAN[];|
|00004410| 09 2f 2a 20 53 74 72 69 | 6e 67 20 63 6f 6e 74 61 |./* Stri|ng conta|
|00004420| 69 6e 69 6e 67 20 2e 74 | 72 61 73 68 63 61 6e 20 |ining .t|rashcan |
|00004430| 64 69 72 65 63 74 6f 72 | 79 2a 2f 09 0a 58 65 78 |director|y*/..Xex|
|00004440| 74 65 72 6e 20 63 68 61 | 72 20 41 4e 53 57 45 52 |tern cha|r ANSWER|
|00004450| 5b 5d 3b 09 09 2f 2a 20 | 53 74 72 69 6e 67 20 75 |[];../* |String u|
|00004460| 73 65 64 20 66 6f 72 20 | 66 69 6e 64 69 6e 67 20 |sed for |finding |
|00004470| 69 6e 74 65 72 61 63 74 | 69 76 65 20 72 65 73 70 |interact|ive resp|
|00004480| 6f 6e 73 65 20 2a 2f 0a | 58 65 78 74 65 72 6e 20 |onse */.|Xextern |
|00004490| 69 6e 74 20 56 45 52 42 | 4f 53 45 3b 09 09 09 2f |int VERB|OSE;.../|
|000044a0| 2a 20 53 65 74 20 69 66 | 20 56 65 72 62 6f 73 65 |* Set if| Verbose|
|000044b0| 20 69 73 20 77 61 6e 74 | 65 64 20 2a 2f 0a 58 65 | is want|ed */.Xe|
|000044c0| 78 74 65 72 6e 20 69 6e | 74 20 49 4e 54 45 52 41 |xtern in|t INTERA|
|000044d0| 43 54 49 56 45 3b 09 09 | 09 2f 2a 20 53 65 74 20 |CTIVE;..|./* Set |
|000044e0| 69 66 20 49 6e 74 65 72 | 61 63 74 69 76 65 20 69 |if Inter|active i|
|000044f0| 73 20 77 61 6e 74 65 64 | 20 2a 2f 0a 58 65 78 74 |s wanted| */.Xext|
|00004500| 65 72 6e 20 6c 6f 6e 67 | 20 54 49 4d 45 3b 09 09 |ern long| TIME;..|
|00004510| 2f 2a 20 55 73 65 64 20 | 74 6f 20 67 65 74 20 74 |/* Used |to get t|
|00004520| 68 65 20 63 75 72 72 65 | 6e 74 20 74 69 6d 65 20 |he curre|nt time |
|00004530| 2a 2f 0a 58 65 78 74 65 | 72 6e 20 69 6e 74 20 65 |*/.Xexte|rn int e|
|00004540| 72 72 6e 6f 3b 09 2f 2a | 20 55 73 65 64 20 74 6f |rrno;./*| Used to|
|00004550| 20 72 65 74 75 72 6e 20 | 74 68 65 20 65 72 72 6f | return |the erro|
|00004560| 72 20 76 61 6c 75 65 20 | 2a 2f 0a 58 74 79 70 65 |r value |*/.Xtype|
|00004570| 64 65 66 20 73 74 72 75 | 63 74 20 75 74 69 6d 62 |def stru|ct utimb|
|00004580| 75 66 0a 58 7b 0a 58 09 | 74 69 6d 65 5f 74 20 61 |uf.X{.X.|time_t a|
|00004590| 63 74 69 6d 65 3b 09 2f | 2a 20 61 63 63 65 73 73 |ctime;./|* access|
|000045a0| 20 74 69 6d 65 20 2a 2f | 0a 58 09 74 69 6d 65 5f | time */|.X.time_|
|000045b0| 74 20 6d 6f 64 74 69 6d | 65 3b 09 2f 2a 20 6d 6f |t modtim|e;./* mo|
|000045c0| 64 69 66 69 63 61 74 69 | 6f 6e 20 74 69 6d 65 20 |dificati|on time |
|000045d0| 2a 2f 0a 58 7d 20 55 54 | 49 4d 42 55 46 3b 09 2f |*/.X} UT|IMBUF;./|
|000045e0| 2a 20 53 74 72 75 63 74 | 75 72 65 20 75 73 65 64 |* Struct|ure used|
|000045f0| 20 74 6f 20 63 68 61 6e | 67 65 20 74 68 65 20 61 | to chan|ge the a|
|00004600| 63 63 65 73 73 20 74 69 | 6d 65 20 2a 2f 0a 58 65 |ccess ti|me */.Xe|
|00004610| 78 74 65 72 6e 20 55 54 | 49 4d 42 55 46 20 54 49 |xtern UT|IMBUF TI|
|00004620| 4d 45 53 3b 0a 45 4e 44 | 5f 4f 46 5f 46 49 4c 45 |MES;.END|_OF_FILE|
|00004630| 0a 69 66 20 74 65 73 74 | 20 31 30 39 36 20 2d 6e |.if test| 1096 -n|
|00004640| 65 20 60 77 63 20 2d 63 | 20 3c 27 63 61 6e 2e 68 |e `wc -c| <'can.h|
|00004650| 27 60 3b 20 74 68 65 6e | 0a 20 20 20 20 65 63 68 |'`; then|. ech|
|00004660| 6f 20 73 68 61 72 3a 20 | 5c 22 27 63 61 6e 2e 68 |o shar: |\"'can.h|
|00004670| 27 5c 22 20 75 6e 70 61 | 63 6b 65 64 20 77 69 74 |'\" unpa|cked wit|
|00004680| 68 20 77 72 6f 6e 67 20 | 73 69 7a 65 21 0a 66 69 |h wrong |size!.fi|
|00004690| 0a 23 20 65 6e 64 20 6f | 66 20 27 63 61 6e 2e 68 |.# end o|f 'can.h|
|000046a0| 27 0a 66 69 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |'.fi.if |test -f |
|000046b0| 27 65 6d 70 74 79 74 72 | 61 73 68 27 20 2d 61 20 |'emptytr|ash' -a |
|000046c0| 22 24 7b 31 7d 22 20 21 | 3d 20 22 2d 63 22 20 3b |"${1}" !|= "-c" ;|
|000046d0| 20 74 68 65 6e 20 0a 20 | 20 65 63 68 6f 20 73 68 | then . | echo sh|
|000046e0| 61 72 3a 20 57 69 6c 6c | 20 6e 6f 74 20 63 6c 6f |ar: Will| not clo|
|000046f0| 62 62 65 72 20 65 78 69 | 73 74 69 6e 67 20 66 69 |bber exi|sting fi|
|00004700| 6c 65 20 5c 22 27 65 6d | 70 74 79 74 72 61 73 68 |le \"'em|ptytrash|
|00004710| 27 5c 22 0a 65 6c 73 65 | 0a 65 63 68 6f 20 73 68 |'\".else|.echo sh|
|00004720| 61 72 3a 20 45 78 74 72 | 61 63 74 69 6e 67 20 5c |ar: Extr|acting \|
|00004730| 22 27 65 6d 70 74 79 74 | 72 61 73 68 27 5c 22 20 |"'emptyt|rash'\" |
|00004740| 5c 28 34 37 32 20 63 68 | 61 72 61 63 74 65 72 73 |\(472 ch|aracters|
|00004750| 5c 29 0a 73 65 64 20 22 | 73 2f 5e 58 2f 2f 22 20 |\).sed "|s/^X//" |
|00004760| 3e 27 65 6d 70 74 79 74 | 72 61 73 68 27 20 3c 3c |>'emptyt|rash' <<|
|00004770| 27 45 4e 44 5f 4f 46 5f | 46 49 4c 45 27 0a 58 3a |'END_OF_|FILE'.X:|
|00004780| 20 2f 62 69 6e 2f 73 68 | 0a 58 0a 58 23 20 45 4d | /bin/sh|.X.X# EM|
|00004790| 50 54 59 54 52 41 53 48 | 20 0a 58 23 20 45 78 65 |PTYTRASH| .X# Exe|
|000047a0| 63 75 74 65 64 20 66 72 | 6f 6d 20 72 6f 6f 74 20 |cuted fr|om root |
|000047b0| 63 72 6f 6e 74 61 62 20 | 66 69 6c 65 20 65 76 65 |crontab |file eve|
|000047c0| 72 79 20 6e 69 67 68 74 | 2e 0a 58 23 20 49 74 20 |ry night|..X# It |
|000047d0| 66 69 6e 64 73 20 61 6c | 6c 20 66 69 6c 65 73 20 |finds al|l files |
|000047e0| 69 6e 20 61 6c 6c 20 75 | 73 65 72 73 20 2e 74 72 |in all u|sers .tr|
|000047f0| 61 73 63 68 61 6e 20 64 | 69 72 65 63 74 6f 72 69 |aschan d|irectori|
|00004800| 65 73 20 61 6e 64 20 67 | 65 74 73 0a 58 23 20 72 |es and g|ets.X# r|
|00004810| 69 64 20 6f 66 20 61 6e | 79 20 66 69 6c 65 20 74 |id of an|y file t|
|00004820| 68 61 74 20 68 61 73 20 | 6e 6f 74 20 62 65 65 6e |hat has |not been|
|00004830| 20 61 63 63 65 73 73 65 | 64 20 6f 72 20 6d 6f 64 | accesse|d or mod|
|00004840| 69 66 69 65 64 20 66 6f | 72 20 6d 6f 72 65 0a 58 |ified fo|r more.X|
|00004850| 23 20 74 68 61 6e 20 37 | 20 64 61 79 73 2e 20 20 |# than 7| days. |
|00004860| 4e 6f 74 65 3a 20 20 74 | 68 69 73 20 77 6f 72 6b |Note: t|his work|
|00004870| 73 20 69 6e 20 63 6f 6e | 6a 75 6e 63 74 69 6f 6e |s in con|junction|
|00004880| 20 77 69 74 68 20 63 61 | 6e 2e 20 20 63 61 6e 0a | with ca|n. can.|
|00004890| 58 23 20 63 68 61 6e 67 | 65 73 20 6d 6f 64 69 66 |X# chang|es modif|
|000048a0| 69 65 73 20 74 68 65 20 | 61 63 63 65 73 73 20 74 |ies the |access t|
|000048b0| 69 6d 65 20 66 6f 72 20 | 61 20 66 69 6c 65 20 77 |ime for |a file w|
|000048c0| 68 65 6e 20 69 74 20 6d | 6f 76 65 73 20 74 68 65 |hen it m|oves the|
|000048d0| 20 20 0a 58 23 20 66 69 | 6c 65 20 74 6f 20 74 68 | .X# fi|le to th|
|000048e0| 65 20 75 73 65 72 27 73 | 20 2e 74 72 61 73 68 63 |e user's| .trashc|
|000048f0| 61 6e 20 64 69 72 65 74 | 6f 72 79 2e 0a 58 0a 58 |an diret|ory..X.X|
|00004900| 66 69 6e 64 20 2f 63 64 | 34 34 31 2f 2a 2f 2e 74 |find /cd|441/*/.t|
|00004910| 72 61 73 68 63 61 6e 20 | 2d 61 74 69 6d 65 20 2b |rashcan |-atime +|
|00004920| 37 20 2d 70 72 69 6e 74 | 20 7c 20 77 68 69 6c 65 |7 -print| | while|
|00004930| 20 72 65 61 64 20 46 49 | 4c 45 0a 58 64 6f 20 0a | read FI|LE.Xdo .|
|00004940| 58 23 20 20 20 20 20 20 | 20 65 63 68 6f 20 24 46 |X# | echo $F|
|00004950| 49 4c 45 0a 58 09 72 6d | 20 24 46 49 4c 45 0a 58 |ILE.X.rm| $FILE.X|
|00004960| 64 6f 6e 65 0a 45 4e 44 | 5f 4f 46 5f 46 49 4c 45 |done.END|_OF_FILE|
|00004970| 0a 69 66 20 74 65 73 74 | 20 34 37 32 20 2d 6e 65 |.if test| 472 -ne|
|00004980| 20 60 77 63 20 2d 63 20 | 3c 27 65 6d 70 74 79 74 | `wc -c |<'emptyt|
|00004990| 72 61 73 68 27 60 3b 20 | 74 68 65 6e 0a 20 20 20 |rash'`; |then. |
|000049a0| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 27 65 | echo sh|ar: \"'e|
|000049b0| 6d 70 74 79 74 72 61 73 | 68 27 5c 22 20 75 6e 70 |mptytras|h'\" unp|
|000049c0| 61 63 6b 65 64 20 77 69 | 74 68 20 77 72 6f 6e 67 |acked wi|th wrong|
|000049d0| 20 73 69 7a 65 21 0a 66 | 69 0a 23 20 65 6e 64 20 | size!.f|i.# end |
|000049e0| 6f 66 20 27 65 6d 70 74 | 79 74 72 61 73 68 27 0a |of 'empt|ytrash'.|
|000049f0| 66 69 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 65 |fi.if te|st -f 'e|
|00004a00| 6d 70 74 79 74 72 61 73 | 68 2e 38 27 20 2d 61 20 |mptytras|h.8' -a |
|00004a10| 22 24 7b 31 7d 22 20 21 | 3d 20 22 2d 63 22 20 3b |"${1}" !|= "-c" ;|
|00004a20| 20 74 68 65 6e 20 0a 20 | 20 65 63 68 6f 20 73 68 | then . | echo sh|
|00004a30| 61 72 3a 20 57 69 6c 6c | 20 6e 6f 74 20 63 6c 6f |ar: Will| not clo|
|00004a40| 62 62 65 72 20 65 78 69 | 73 74 69 6e 67 20 66 69 |bber exi|sting fi|
|00004a50| 6c 65 20 5c 22 27 65 6d | 70 74 79 74 72 61 73 68 |le \"'em|ptytrash|
|00004a60| 2e 38 27 5c 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |.8'\".el|se.echo |
|00004a70| 73 68 61 72 3a 20 45 78 | 74 72 61 63 74 69 6e 67 |shar: Ex|tracting|
|00004a80| 20 5c 22 27 65 6d 70 74 | 79 74 72 61 73 68 2e 38 | \"'empt|ytrash.8|
|00004a90| 27 5c 22 20 5c 28 38 37 | 31 20 63 68 61 72 61 63 |'\" \(87|1 charac|
|00004aa0| 74 65 72 73 5c 29 0a 73 | 65 64 20 22 73 2f 5e 58 |ters\).s|ed "s/^X|
|00004ab0| 2f 2f 22 20 3e 27 65 6d | 70 74 79 74 72 61 73 68 |//" >'em|ptytrash|
|00004ac0| 2e 38 27 20 3c 3c 27 45 | 4e 44 5f 4f 46 5f 46 49 |.8' <<'E|ND_OF_FI|
|00004ad0| 4c 45 27 0a 58 2e 5c 22 | 20 40 28 23 29 72 75 6e |LE'.X.\"| @(#)run|
|00004ae0| 2e 31 09 31 30 2e 32 20 | 28 4d 41 53 53 43 4f 4d |.1.10.2 |(MASSCOM|
|00004af0| 50 29 20 38 2f 31 34 2f | 38 36 0a 58 2e 52 4c 20 |P) 8/14/|86.X.RL |
|00004b00| 22 6c 6f 63 61 6c 22 0a | 58 2e 54 48 20 45 4d 50 |"local".|X.TH EMP|
|00004b10| 54 59 54 52 41 53 48 20 | 38 0a 58 2e 53 48 20 4e |TYTRASH |8.X.SH N|
|00004b20| 41 4d 45 0a 58 65 6d 70 | 74 79 74 72 61 73 68 20 |AME.Xemp|tytrash |
|00004b30| 5c 2d 20 74 68 65 20 74 | 72 61 73 68 20 63 6f 6c |\- the t|rash col|
|00004b40| 6c 65 63 74 6f 72 20 75 | 73 65 64 20 77 69 74 68 |lector u|sed with|
|00004b50| 0a 58 2e 49 20 63 61 6e | 0a 58 2e 53 48 20 53 59 |.X.I can|.X.SH SY|
|00004b60| 4e 4f 50 53 49 53 0a 58 | 5c 66 42 65 6d 70 74 79 |NOPSIS.X|\fBempty|
|00004b70| 74 72 61 73 68 0a 58 2e | 62 72 0a 58 2e 6e 73 0a |trash.X.|br.X.ns.|
|00004b80| 58 2e 53 48 20 44 45 53 | 43 52 49 50 54 49 4f 4e |X.SH DES|CRIPTION|
|00004b90| 0a 58 2e 49 20 45 6d 70 | 74 79 74 72 61 73 68 0a |.X.I Emp|tytrash.|
|00004ba0| 58 73 69 6d 70 6c 79 20 | 6c 6f 6f 6b 73 20 69 6e |Xsimply |looks in|
|00004bb0| 74 6f 20 65 61 63 68 20 | 24 48 4f 4d 45 2f 2e 74 |to each |$HOME/.t|
|00004bc0| 72 61 73 68 63 61 6e 20 | 61 6e 64 20 63 68 65 63 |rashcan |and chec|
|00004bd0| 6b 73 20 74 68 65 20 6c | 61 73 74 20 61 63 63 65 |ks the l|ast acce|
|00004be0| 73 73 20 74 69 6d 65 0a | 58 77 68 69 63 68 20 69 |ss time.|Xwhich i|
|00004bf0| 73 20 75 73 75 61 6c 6c | 79 20 73 65 74 20 62 79 |s usuall|y set by|
|00004c00| 0a 58 2e 49 20 63 61 6e | 28 31 29 2e 0a 58 41 6e |.X.I can|(1)..XAn|
|00004c10| 79 74 68 69 6e 67 20 74 | 68 61 74 20 69 74 20 66 |ything t|hat it f|
|00004c20| 69 6e 64 73 20 74 68 61 | 74 20 69 73 20 6d 6f 72 |inds tha|t is mor|
|00004c30| 65 20 74 68 61 6e 20 73 | 65 76 65 6e 20 64 61 79 |e than s|even day|
|00004c40| 73 20 6f 6c 64 20 69 74 | 20 70 65 72 6d 61 6e 65 |s old it| permane|
|00004c50| 6e 74 6c 79 0a 58 72 65 | 6d 6f 76 65 73 20 76 69 |ntly.Xre|moves vi|
|00004c60| 61 20 0a 58 2e 49 20 72 | 6d 28 31 29 2e 0a 58 54 |a .X.I r|m(1)..XT|
|00004c70| 68 69 73 20 61 6d 6f 75 | 6e 74 20 6f 66 20 74 69 |his amou|nt of ti|
|00004c80| 6d 65 20 63 61 6e 20 62 | 65 20 63 68 61 6e 67 65 |me can b|e change|
|00004c90| 64 20 62 79 20 63 68 61 | 6e 67 69 6e 67 20 74 68 |d by cha|nging th|
|00004ca0| 65 20 22 37 22 20 69 6e | 20 74 68 65 20 73 63 72 |e "7" in| the scr|
|00004cb0| 69 70 74 20 66 69 6c 65 | 2e 0a 58 54 68 65 20 62 |ipt file|..XThe b|
|00004cc0| 65 73 74 20 74 68 69 6e | 67 20 74 6f 20 64 6f 20 |est thin|g to do |
|00004cd0| 69 73 20 74 6f 20 70 75 | 74 20 74 68 69 73 20 69 |is to pu|t this i|
|00004ce0| 6e 20 79 6f 75 72 20 72 | 6f 6f 74 20 63 72 6f 6e |n your r|oot cron|
|00004cf0| 74 61 62 20 66 69 6c 65 | 20 61 6e 64 20 68 61 76 |tab file| and hav|
|00004d00| 65 20 69 74 0a 58 65 78 | 65 63 75 74 65 64 20 65 |e it.Xex|ecuted e|
|00004d10| 76 65 72 79 64 61 79 2e | 0a 58 2e 53 48 20 46 49 |veryday.|.X.SH FI|
|00004d20| 4c 45 53 0a 58 2e 54 50 | 20 32 2e 35 69 0a 58 24 |LES.X.TP| 2.5i.X$|
|00004d30| 48 4f 4d 45 2f 2e 74 72 | 61 73 68 63 61 6e 0a 58 |HOME/.tr|ashcan.X|
|00004d40| 54 68 65 20 72 65 73 65 | 72 76 6f 69 72 20 6f 66 |The rese|rvoir of|
|00004d50| 20 63 61 6e 6e 65 64 20 | 66 69 6c 65 73 0a 58 2e | canned |files.X.|
|00004d60| 53 48 20 53 45 45 20 41 | 4c 53 4f 0a 58 2e 49 0a |SH SEE A|LSO.X.I.|
|00004d70| 58 63 61 6e 28 31 29 2c | 20 72 6d 28 31 29 0a 58 |Xcan(1),| rm(1).X|
|00004d80| 2e 53 48 20 42 55 47 53 | 0a 58 4f 6e 6c 79 20 74 |.SH BUGS|.XOnly t|
|00004d90| 68 61 74 20 74 68 69 73 | 20 77 61 73 20 61 20 71 |hat this| was a q|
|00004da0| 75 69 63 6b 79 20 61 6e | 64 20 63 6f 75 6c 64 20 |uicky an|d could |
|00004db0| 62 65 20 6d 61 64 65 20 | 62 65 74 74 65 72 20 62 |be made |better b|
|00004dc0| 79 20 68 61 76 69 6e 67 | 20 69 74 20 61 63 63 65 |y having| it acce|
|00004dd0| 70 74 20 61 6e 0a 58 61 | 72 67 75 6d 65 6e 74 20 |pt an.Xa|rgument |
|00004de0| 74 68 61 74 20 77 6f 75 | 6c 64 20 64 65 74 65 72 |that wou|ld deter|
|00004df0| 6d 69 6e 65 20 74 68 65 | 20 61 6d 6f 75 6e 74 20 |mine the| amount |
|00004e00| 6f 66 20 65 6c 61 70 73 | 65 64 20 74 69 6d 65 20 |of elaps|ed time |
|00004e10| 74 6f 20 63 68 65 63 6b | 20 66 6f 72 2e 0a 58 2e |to check| for..X.|
|00004e20| 53 48 20 41 55 54 48 4f | 52 0a 58 54 68 65 20 42 |SH AUTHO|R.XThe B|
|00004e30| 69 74 20 42 75 74 63 68 | 65 72 0a 58 2e 62 72 0a |it Butch|er.X.br.|
|00004e40| 58 57 69 74 68 20 74 68 | 65 20 68 65 6c 70 20 6f |XWith th|e help o|
|00004e50| 66 20 53 74 65 70 68 20 | 4c 75 73 65 2e 0a 45 4e |f Steph |Luse..EN|
|00004e60| 44 5f 4f 46 5f 46 49 4c | 45 0a 69 66 20 74 65 73 |D_OF_FIL|E.if tes|
|00004e70| 74 20 38 37 31 20 2d 6e | 65 20 60 77 63 20 2d 63 |t 871 -n|e `wc -c|
|00004e80| 20 3c 27 65 6d 70 74 79 | 74 72 61 73 68 2e 38 27 | <'empty|trash.8'|
|00004e90| 60 3b 20 74 68 65 6e 0a | 20 20 20 20 65 63 68 6f |`; then.| echo|
|00004ea0| 20 73 68 61 72 3a 20 5c | 22 27 65 6d 70 74 79 74 | shar: \|"'emptyt|
|00004eb0| 72 61 73 68 2e 38 27 5c | 22 20 75 6e 70 61 63 6b |rash.8'\|" unpack|
|00004ec0| 65 64 20 77 69 74 68 20 | 77 72 6f 6e 67 20 73 69 |ed with |wrong si|
|00004ed0| 7a 65 21 0a 66 69 0a 23 | 20 65 6e 64 20 6f 66 20 |ze!.fi.#| end of |
|00004ee0| 27 65 6d 70 74 79 74 72 | 61 73 68 2e 38 27 0a 66 |'emptytr|ash.8'.f|
|00004ef0| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 72 65 |i.if tes|t -f 're|
|00004f00| 63 75 72 63 61 6e 2e 63 | 27 20 2d 61 20 22 24 7b |curcan.c|' -a "${|
|00004f10| 31 7d 22 20 21 3d 20 22 | 2d 63 22 20 3b 20 74 68 |1}" != "|-c" ; th|
|00004f20| 65 6e 20 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |en . ec|ho shar:|
|00004f30| 20 57 69 6c 6c 20 6e 6f | 74 20 63 6c 6f 62 62 65 | Will no|t clobbe|
|00004f40| 72 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |r existi|ng file |
|00004f50| 5c 22 27 72 65 63 75 72 | 63 61 6e 2e 63 27 5c 22 |\"'recur|can.c'\"|
|00004f60| 0a 65 6c 73 65 0a 65 63 | 68 6f 20 73 68 61 72 3a |.else.ec|ho shar:|
|00004f70| 20 45 78 74 72 61 63 74 | 69 6e 67 20 5c 22 27 72 | Extract|ing \"'r|
|00004f80| 65 63 75 72 63 61 6e 2e | 63 27 5c 22 20 5c 28 33 |ecurcan.|c'\" \(3|
|00004f90| 34 36 30 20 63 68 61 72 | 61 63 74 65 72 73 5c 29 |460 char|acters\)|
|00004fa0| 0a 73 65 64 20 22 73 2f | 5e 58 2f 2f 22 20 3e 27 |.sed "s/|^X//" >'|
|00004fb0| 72 65 63 75 72 63 61 6e | 2e 63 27 20 3c 3c 27 45 |recurcan|.c' <<'E|
|00004fc0| 4e 44 5f 4f 46 5f 46 49 | 4c 45 27 0a 58 2f 2a 2a |ND_OF_FI|LE'.X/**|
|00004fd0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004fe0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004ff0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005000| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005010| 2a 2a 2a 2a 2a 2a 0a 58 | 2a 0a 58 2a 09 52 45 43 |******.X|*.X*.REC|
|00005020| 55 52 43 41 4e 2e 43 0a | 58 2a 09 09 74 68 69 73 |URCAN.C.|X*..this|
|00005030| 20 69 73 20 75 73 65 64 | 20 74 6f 20 74 72 61 76 | is used| to trav|
|00005040| 65 72 73 65 20 61 20 64 | 69 72 65 63 74 6f 72 79 |erse a d|irectory|
|00005050| 20 74 72 65 65 20 77 68 | 65 6e 20 64 6f 69 6e 67 | tree wh|en doing|
|00005060| 20 61 0a 58 2a 09 09 72 | 65 63 75 72 73 69 76 65 | a.X*..r|ecursive|
|00005070| 20 63 61 6e 20 70 61 73 | 73 65 64 20 74 68 65 20 | can pas|sed the |
|00005080| 64 69 72 65 63 74 6f 72 | 79 20 74 6f 20 62 65 20 |director|y to be |
|00005090| 65 78 61 6d 69 6e 65 64 | 0a 58 2a 0a 58 2a 2a 2a |examined|.X*.X***|
|000050a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000050b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000050c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000050d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000050e0| 2a 2a 2a 2a 2a 2f 0a 58 | 0a 58 23 69 6e 63 6c 75 |*****/.X|.X#inclu|
|000050f0| 64 65 20 22 63 61 6e 2e | 68 22 0a 58 0a 58 76 6f |de "can.|h".X.Xvo|
|00005100| 69 64 20 72 65 63 75 72 | 63 61 6e 28 74 65 6d 70 |id recur|can(temp|
|00005110| 29 0a 58 63 68 61 72 20 | 2a 74 65 6d 70 3b 0a 58 |).Xchar |*temp;.X|
|00005120| 7b 0a 58 09 44 49 52 20 | 2a 44 49 52 50 3b 09 09 |{.X.DIR |*DIRP;..|
|00005130| 2f 2a 20 55 73 65 64 20 | 74 6f 20 6c 69 73 74 20 |/* Used |to list |
|00005140| 74 68 65 20 64 69 72 65 | 63 74 6f 72 79 20 62 79 |the dire|ctory by|
|00005150| 20 70 6f 69 6e 74 69 6e | 67 20 61 74 20 2e 74 72 | pointin|g at .tr|
|00005160| 61 73 68 63 61 6e 20 2a | 2f 0a 58 09 73 74 72 75 |ashcan *|/.X.stru|
|00005170| 63 74 20 64 69 72 65 63 | 74 20 2a 44 50 3b 09 2f |ct direc|t *DP;./|
|00005180| 2a 20 55 73 65 64 20 74 | 6f 20 70 6f 69 6e 74 20 |* Used t|o point |
|00005190| 61 74 20 63 6f 6e 73 65 | 63 75 74 69 76 65 20 65 |at conse|cutive e|
|000051a0| 6e 74 72 69 65 73 20 77 | 68 65 6e 20 6c 69 73 74 |ntries w|hen list|
|000051b0| 69 6e 67 20 2a 2f 0a 58 | 09 63 68 61 72 20 46 49 |ing */.X|.char FI|
|000051c0| 4c 45 4e 41 4d 45 5b 4d | 41 58 50 41 54 48 4c 45 |LENAME[M|AXPATHLE|
|000051d0| 4e 5d 3b 09 2f 2a 20 53 | 74 72 69 6e 67 20 63 6f |N];./* S|tring co|
|000051e0| 6e 74 61 69 6e 69 6e 67 | 20 2e 74 72 61 73 68 63 |ntaining| .trashc|
|000051f0| 61 6e 2f 63 75 72 72 65 | 6e 74 20 66 69 6c 65 2a |an/curre|nt file*|
|00005200| 2f 09 0a 58 09 63 68 61 | 72 20 2a 41 43 54 4e 41 |/..X.cha|r *ACTNA|
|00005210| 4d 45 3b 09 09 2f 2a 20 | 50 6f 69 6e 74 73 20 74 |ME;../* |Points t|
|00005220| 6f 20 66 69 6c 65 6e 61 | 6d 65 20 77 69 74 68 6f |o filena|me witho|
|00005230| 75 74 20 61 6e 79 20 6c | 65 61 64 69 6e 67 20 64 |ut any l|eading d|
|00005240| 69 72 65 63 74 6f 72 79 | 20 2a 2f 0a 58 09 73 74 |irectory| */.X.st|
|00005250| 72 75 63 74 20 73 74 61 | 74 20 42 55 46 3b 09 2f |ruct sta|t BUF;./|
|00005260| 2a 20 55 73 65 64 20 74 | 6f 20 70 6f 69 6e 74 20 |* Used t|o point |
|00005270| 74 6f 20 6d 6f 64 65 20 | 69 6e 66 6f 20 61 62 6f |to mode |info abo|
|00005280| 75 74 20 66 69 6c 65 73 | 20 2a 2f 0a 58 09 63 68 |ut files| */.X.ch|
|00005290| 61 72 20 54 45 4d 50 5b | 4d 41 58 50 41 54 48 4c |ar TEMP[|MAXPATHL|
|000052a0| 45 4e 5d 3b 09 2f 2a 20 | 74 68 69 73 20 69 73 20 |EN];./* |this is |
|000052b0| 75 73 65 64 20 74 6f 20 | 6c 6f 6f 6b 20 61 74 20 |used to |look at |
|000052c0| 74 68 65 20 63 75 72 72 | 65 6e 74 20 66 69 6c 65 |the curr|ent file|
|000052d0| 20 2a 2f 0a 58 09 63 68 | 61 72 20 57 4f 52 4b 44 | */.X.ch|ar WORKD|
|000052e0| 49 52 5b 4d 41 58 50 41 | 54 48 4c 45 4e 5d 3b 09 |IR[MAXPA|THLEN];.|
|000052f0| 2f 2a 20 74 68 65 20 77 | 6f 72 6b 69 6e 67 20 64 |/* the w|orking d|
|00005300| 69 72 65 63 74 6f 72 79 | 20 77 65 20 63 61 6d 65 |irectory| we came|
|00005310| 20 66 72 6f 6d 20 2a 2f | 0a 58 0a 58 09 44 49 52 | from */|.X.X.DIR|
|00005320| 50 20 3d 20 6f 70 65 6e | 64 69 72 28 74 65 6d 70 |P = open|dir(temp|
|00005330| 29 3b 09 2f 2a 20 6f 70 | 65 6e 20 74 68 65 20 64 |);./* op|en the d|
|00005340| 69 72 65 63 74 6f 72 79 | 20 62 65 69 6e 67 20 63 |irectory| being c|
|00005350| 61 6e 6e 65 64 20 2a 2f | 0a 58 09 67 65 74 77 64 |anned */|.X.getwd|
|00005360| 28 57 4f 52 4b 44 49 52 | 29 3b 09 2f 2a 20 67 65 |(WORKDIR|);./* ge|
|00005370| 74 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 77 6f |t the cu|rrent wo|
|00005380| 72 6b 69 6e 67 20 64 69 | 72 65 63 74 6f 72 79 20 |rking di|rectory |
|00005390| 2a 2f 0a 58 09 63 68 64 | 69 72 28 74 65 6d 70 29 |*/.X.chd|ir(temp)|
|000053a0| 3b 09 2f 2a 20 67 6f 20 | 74 6f 20 74 68 65 20 64 |;./* go |to the d|
|000053b0| 69 72 65 63 74 6f 72 79 | 20 74 6f 20 62 65 20 63 |irectory| to be c|
|000053c0| 61 6e 6e 65 64 20 2a 2f | 0a 58 09 2f 2a 20 67 65 |anned */|.X./* ge|
|000053d0| 74 20 74 68 65 20 6e 65 | 78 74 20 64 69 72 65 63 |t the ne|xt direc|
|000053e0| 74 6f 72 79 20 65 6e 74 | 72 79 20 2a 2f 0a 58 09 |tory ent|ry */.X.|
|000053f0| 66 6f 72 28 44 50 20 3d | 20 72 65 61 64 64 69 72 |for(DP =| readdir|
|00005400| 28 44 49 52 50 29 3b 20 | 44 50 20 21 3d 20 4e 55 |(DIRP); |DP != NU|
|00005410| 4c 4c 3b 20 44 50 3d 20 | 72 65 61 64 64 69 72 28 |LL; DP= |readdir(|
|00005420| 44 49 52 50 29 29 0a 58 | 09 7b 0a 58 09 09 73 74 |DIRP)).X|.{.X..st|
|00005430| 72 63 70 79 28 54 45 4d | 50 2c 20 44 50 2d 3e 64 |rcpy(TEM|P, DP->d|
|00005440| 5f 6e 61 6d 65 29 3b 09 | 2f 2a 20 70 75 74 20 74 |_name);.|/* put t|
|00005450| 68 65 20 6e 61 6d 65 20 | 69 6e 20 54 45 4d 50 20 |he name |in TEMP |
|00005460| 2a 2f 0a 58 09 09 73 74 | 61 74 28 54 45 4d 50 2c |*/.X..st|at(TEMP,|
|00005470| 20 26 42 55 46 29 3b 09 | 2f 2a 20 67 65 74 20 73 | &BUF);.|/* get s|
|00005480| 6f 6d 65 20 69 6e 66 6f | 20 61 62 6f 75 74 20 74 |ome info| about t|
|00005490| 68 69 73 20 66 69 6c 65 | 20 2a 2f 0a 58 09 09 2f |his file| */.X../|
|000054a0| 2a 20 64 6f 65 73 20 69 | 74 20 65 78 69 73 74 20 |* does i|t exist |
|000054b0| 61 6e 64 20 69 73 20 69 | 74 20 6e 6f 74 20 61 20 |and is i|t not a |
|000054c0| 64 69 72 65 63 74 6f 72 | 79 20 2a 2f 0a 58 09 09 |director|y */.X..|
|000054d0| 69 66 20 28 28 61 63 63 | 65 73 73 28 54 45 4d 50 |if ((acc|ess(TEMP|
|000054e0| 2c 20 46 5f 4f 4b 29 20 | 3d 3d 20 30 29 20 26 26 |, F_OK) |== 0) &&|
|000054f0| 20 28 21 28 42 55 46 2e | 73 74 5f 6d 6f 64 65 20 | (!(BUF.|st_mode |
|00005500| 26 20 30 30 34 30 30 30 | 30 29 29 29 0a 58 09 09 |& 004000|0))).X..|
|00005510| 7b 0a 58 09 09 09 2f 2a | 20 69 6e 74 65 72 6f 67 |{.X.../*| interog|
|00005520| 61 74 65 20 2a 2f 0a 58 | 09 09 09 69 66 28 49 4e |ate */.X|...if(IN|
|00005530| 54 45 52 41 43 54 49 56 | 45 20 21 3d 20 30 29 0a |TERACTIV|E != 0).|
|00005540| 58 09 09 09 7b 0a 58 09 | 09 09 09 66 70 72 69 6e |X...{.X.|...fprin|
|00005550| 74 66 28 73 74 64 6f 75 | 74 2c 20 22 63 61 6e 20 |tf(stdou|t, "can |
|00005560| 25 73 5c 3f 20 22 2c 20 | 54 45 4d 50 29 3b 0a 58 |%s\? ", |TEMP);.X|
|00005570| 09 09 09 09 66 73 63 61 | 6e 66 28 73 74 64 69 6e |....fsca|nf(stdin|
|00005580| 2c 20 22 25 73 22 2c 20 | 41 4e 53 57 45 52 29 3b |, "%s", |ANSWER);|
|00005590| 0a 58 09 09 09 09 69 66 | 28 28 41 4e 53 57 45 52 |.X....if|((ANSWER|
|000055a0| 5b 30 5d 20 21 3d 20 27 | 79 27 29 20 26 26 20 28 |[0] != '|y') && (|
|000055b0| 41 4e 53 57 45 52 5b 30 | 5d 20 21 3d 20 27 59 27 |ANSWER[0|] != 'Y'|
|000055c0| 29 29 0a 58 09 09 09 09 | 09 63 6f 6e 74 69 6e 75 |)).X....|.continu|
|000055d0| 65 3b 0a 58 09 09 09 7d | 0a 58 09 09 09 2f 2a 20 |e;.X...}|.X.../* |
|000055e0| 6d 61 6b 65 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |make the| name of|
|000055f0| 20 74 68 65 20 74 72 61 | 73 68 20 66 69 6c 65 20 | the tra|sh file |
|00005600| 2a 2f 0a 58 09 09 09 73 | 70 72 69 6e 74 66 28 46 |*/.X...s|printf(F|
|00005610| 49 4c 45 4e 41 4d 45 2c | 20 22 25 73 2f 25 73 22 |ILENAME,| "%s/%s"|
|00005620| 2c 20 43 41 4e 2c 20 54 | 45 4d 50 29 3b 0a 58 09 |, CAN, T|EMP);.X.|
|00005630| 09 09 2f 2a 20 67 65 74 | 20 72 69 64 20 6f 66 20 |../* get| rid of |
|00005640| 74 68 65 20 74 72 61 73 | 68 20 76 65 72 73 69 6f |the tras|h versio|
|00005650| 6e 20 69 66 20 74 68 65 | 72 65 20 69 73 20 6f 6e |n if the|re is on|
|00005660| 65 20 2a 2f 0a 58 09 09 | 09 69 66 20 28 61 63 63 |e */.X..|.if (acc|
|00005670| 65 73 73 28 46 49 4c 45 | 4e 41 4d 45 2c 20 46 5f |ess(FILE|NAME, F_|
|00005680| 4f 4b 29 20 3d 3d 20 30 | 29 0a 58 09 09 09 09 69 |OK) == 0|).X....i|
|00005690| 66 28 75 6e 6c 69 6e 6b | 28 46 49 4c 45 4e 41 4d |f(unlink|(FILENAM|
|000056a0| 45 29 20 21 3d 20 30 29 | 0a 58 09 09 09 09 7b 0a |E) != 0)|.X....{.|
|000056b0| 58 09 09 09 09 09 70 65 | 72 72 6f 72 28 22 63 61 |X.....pe|rror("ca|
|000056c0| 6e 37 22 29 3b 0a 58 09 | 09 09 09 09 63 6f 6e 74 |n7");.X.|....cont|
|000056d0| 69 6e 75 65 3b 0a 58 09 | 09 09 09 7d 0a 58 09 09 |inue;.X.|...}.X..|
|000056e0| 09 2f 2a 20 70 75 74 20 | 66 69 6c 65 20 69 6e 20 |./* put |file in |
|000056f0| 74 68 65 20 74 72 61 73 | 68 20 2a 2f 0a 58 09 09 |the tras|h */.X..|
|00005700| 09 69 66 28 6c 69 6e 6b | 28 54 45 4d 50 2c 20 46 |.if(link|(TEMP, F|
|00005710| 49 4c 45 4e 41 4d 45 29 | 20 21 3d 20 30 29 0a 58 |ILENAME)| != 0).X|
|00005720| 09 09 09 7b 0a 58 09 09 | 09 09 73 77 69 74 63 68 |...{.X..|..switch|
|00005730| 28 65 72 72 6e 6f 29 0a | 58 09 09 09 09 7b 0a 58 |(errno).|X....{.X|
|00005740| 09 09 09 09 09 63 61 73 | 65 20 45 58 44 45 56 3a |.....cas|e EXDEV:|
|00005750| 0a 58 09 09 09 09 09 09 | 63 72 6f 73 73 64 65 76 |.X......|crossdev|
|00005760| 63 61 6e 28 54 45 4d 50 | 2c 20 46 49 4c 45 4e 41 |can(TEMP|, FILENA|
|00005770| 4d 45 29 3b 0a 58 09 09 | 09 09 09 09 62 72 65 61 |ME);.X..|....brea|
|00005780| 6b 3b 0a 58 09 09 09 09 | 09 64 65 66 61 75 6c 74 |k;.X....|.default|
|00005790| 3a 0a 58 09 09 09 09 09 | 09 70 65 72 72 6f 72 28 |:.X.....|.perror(|
|000057a0| 22 63 61 6e 32 22 29 3b | 0a 58 09 09 09 09 09 09 |"can2");|.X......|
|000057b0| 63 6f 6e 74 69 6e 75 65 | 3b 0a 58 09 09 09 09 7d |continue|;.X....}|
|000057c0| 0a 58 09 09 09 7d 0a 58 | 09 09 09 2f 2a 20 67 65 |.X...}.X|.../* ge|
|000057d0| 74 20 72 69 64 20 6f 66 | 20 74 68 65 20 66 69 6c |t rid of| the fil|
|000057e0| 65 20 68 65 72 65 20 2a | 2f 0a 58 09 09 09 69 66 |e here *|/.X...if|
|000057f0| 28 75 6e 6c 69 6e 6b 28 | 54 45 4d 50 29 20 21 3d |(unlink(|TEMP) !=|
|00005800| 20 30 29 0a 58 09 09 09 | 7b 0a 58 09 09 09 09 70 | 0).X...|{.X....p|
|00005810| 65 72 72 6f 72 28 22 63 | 61 6e 38 22 29 3b 0a 58 |error("c|an8");.X|
|00005820| 09 09 09 09 63 6f 6e 74 | 69 6e 75 65 3b 0a 58 09 |....cont|inue;.X.|
|00005830| 09 09 7d 0a 58 09 09 09 | 2f 2a 20 63 68 61 6e 67 |..}.X...|/* chang|
|00005840| 65 20 74 68 65 20 61 63 | 63 65 73 73 20 74 69 6d |e the ac|cess tim|
|00005850| 65 20 2a 2f 0a 58 09 09 | 09 54 49 4d 45 53 2e 61 |e */.X..|.TIMES.a|
|00005860| 63 74 69 6d 65 3d 20 28 | 74 69 6d 65 5f 74 29 54 |ctime= (|time_t)T|
|00005870| 49 4d 45 3b 0a 58 09 09 | 09 54 49 4d 45 53 2e 6d |IME;.X..|.TIMES.m|
|00005880| 6f 64 74 69 6d 65 3d 20 | 42 55 46 2e 73 74 5f 6d |odtime= |BUF.st_m|
|00005890| 74 69 6d 65 3b 0a 58 09 | 09 09 69 66 28 75 74 69 |time;.X.|..if(uti|
|000058a0| 6d 65 28 46 49 4c 45 4e | 41 4d 45 2c 20 26 54 49 |me(FILEN|AME, &TI|
|000058b0| 4d 45 53 29 20 21 3d 20 | 30 29 0a 58 09 09 09 7b |MES) != |0).X...{|
|000058c0| 0a 58 09 09 09 09 70 65 | 72 72 6f 72 28 22 63 61 |.X....pe|rror("ca|
|000058d0| 6e 39 22 29 3b 0a 58 09 | 09 09 09 63 6f 6e 74 69 |n9");.X.|...conti|
|000058e0| 6e 75 65 3b 0a 58 09 09 | 09 7d 0a 58 09 09 09 2f |nue;.X..|.}.X.../|
|000058f0| 2a 20 74 65 6c 6c 20 74 | 68 65 6d 20 77 68 61 74 |* tell t|hem what|
|00005900| 20 68 61 70 70 65 6e 65 | 64 20 69 66 20 74 68 65 | happene|d if the|
|00005910| 79 20 77 61 6e 74 20 74 | 6f 20 6b 6e 6f 77 20 2a |y want t|o know *|
|00005920| 2f 0a 58 09 09 09 69 66 | 28 56 45 52 42 4f 53 45 |/.X...if|(VERBOSE|
|00005930| 29 0a 58 09 09 09 09 66 | 70 72 69 6e 74 66 28 73 |).X....f|printf(s|
|00005940| 74 64 6f 75 74 2c 20 22 | 25 73 3a 20 63 61 6e 6e |tdout, "|%s: cann|
|00005950| 65 64 5c 6e 22 2c 20 54 | 45 4d 50 29 3b 0a 58 09 |ed\n", T|EMP);.X.|
|00005960| 09 7d 0a 58 09 09 65 6c | 73 65 0a 58 09 09 7b 0a |.}.X..el|se.X..{.|
|00005970| 58 09 09 09 2f 2a 20 69 | 73 20 69 74 20 61 20 64 |X.../* i|s it a d|
|00005980| 69 72 65 63 74 6f 72 79 | 3f 20 2a 2f 0a 58 09 09 |irectory|? */.X..|
|00005990| 09 69 66 28 42 55 46 2e | 73 74 5f 6d 6f 64 65 20 |.if(BUF.|st_mode |
|000059a0| 26 20 30 30 34 30 30 30 | 30 29 0a 58 09 09 09 7b |& 004000|0).X...{|
|000059b0| 0a 58 09 09 09 09 2f 2a | 20 6d 61 6b 65 20 73 75 |.X..../*| make su|
|000059c0| 72 65 20 69 74 20 69 73 | 20 6e 6f 74 20 22 2e 2e |re it is| not "..|
|000059d0| 22 20 6f 72 20 22 2e 22 | 20 2a 2f 0a 58 09 09 09 |" or "."| */.X...|
|000059e0| 09 69 66 28 28 73 74 72 | 63 6d 70 28 54 45 4d 50 |.if((str|cmp(TEMP|
|000059f0| 2c 22 2e 2e 22 29 20 21 | 3d 20 30 29 20 26 26 20 |,"..") !|= 0) && |
|00005a00| 28 73 74 72 63 6d 70 28 | 54 45 4d 50 2c 22 2e 22 |(strcmp(|TEMP,"."|
|00005a10| 29 20 21 3d 20 30 29 29 | 0a 58 09 09 09 09 7b 0a |) != 0))|.X....{.|
|00005a20| 58 09 09 09 09 09 2f 2a | 20 6d 61 6b 65 20 73 75 |X...../*| make su|
|00005a30| 72 65 20 74 68 65 79 20 | 77 61 6e 74 20 74 6f 20 |re they |want to |
|00005a40| 6c 6f 6f 6b 20 61 74 20 | 74 68 69 73 20 64 69 72 |look at |this dir|
|00005a50| 65 63 74 6f 72 79 20 2a | 2f 0a 58 09 09 09 09 09 |ectory *|/.X.....|
|00005a60| 69 66 28 49 4e 54 45 52 | 41 43 54 49 56 45 20 21 |if(INTER|ACTIVE !|
|00005a70| 3d 20 30 29 0a 58 09 09 | 09 09 09 7b 0a 58 09 09 |= 0).X..|...{.X..|
|00005a80| 09 09 09 09 66 70 72 69 | 6e 74 66 28 73 74 64 6f |....fpri|ntf(stdo|
|00005a90| 75 74 2c 20 22 63 61 6e | 20 63 68 65 63 6b 20 25 |ut, "can| check %|
|00005aa0| 73 20 64 69 72 65 63 74 | 6f 72 79 5c 3f 20 22 2c |s direct|ory\? ",|
|00005ab0| 20 54 45 4d 50 29 3b 0a | 58 09 09 09 09 09 09 66 | TEMP);.|X......f|
|00005ac0| 73 63 61 6e 66 28 73 74 | 64 69 6e 2c 20 22 25 73 |scanf(st|din, "%s|
|00005ad0| 22 2c 20 41 4e 53 57 45 | 52 29 3b 0a 58 09 09 09 |", ANSWE|R);.X...|
|00005ae0| 09 09 09 69 66 28 28 41 | 4e 53 57 45 52 5b 30 5d |...if((A|NSWER[0]|
|00005af0| 20 21 3d 20 27 79 27 29 | 20 26 26 20 28 41 4e 53 | != 'y')| && (ANS|
|00005b00| 57 45 52 5b 30 5d 20 21 | 3d 20 27 59 27 29 29 0a |WER[0] !|= 'Y')).|
|00005b10| 58 09 09 09 09 09 09 09 | 63 6f 6e 74 69 6e 75 65 |X.......|continue|
|00005b20| 3b 0a 58 09 09 09 09 09 | 7d 0a 58 09 09 09 09 09 |;.X.....|}.X.....|
|00005b30| 2f 2a 20 67 65 74 20 6f | 6e 20 77 69 74 68 20 72 |/* get o|n with r|
|00005b40| 65 63 75 72 73 69 6f 6e | 20 75 73 69 6e 67 20 6e |ecursion| using n|
|00005b50| 65 77 65 73 74 20 64 69 | 72 65 63 74 6f 72 79 20 |ewest di|rectory |
|00005b60| 2a 2f 0a 58 09 09 09 09 | 09 72 65 63 75 72 63 61 |*/.X....|.recurca|
|00005b70| 6e 28 54 45 4d 50 29 3b | 0a 58 09 09 09 09 7d 0a |n(TEMP);|.X....}.|
|00005b80| 58 09 09 09 7d 0a 58 09 | 09 09 65 6c 73 65 0a 58 |X...}.X.|..else.X|
|00005b90| 09 09 09 09 70 65 72 72 | 6f 72 28 22 63 61 6e 31 |....perr|or("can1|
|00005ba0| 30 22 29 3b 0a 58 09 09 | 7d 0a 58 09 7d 0a 58 09 |0");.X..|}.X.}.X.|
|00005bb0| 63 68 64 69 72 28 57 4f | 52 4b 44 49 52 29 3b 09 |chdir(WO|RKDIR);.|
|00005bc0| 2f 2a 20 67 6f 20 62 61 | 63 6b 20 74 6f 20 64 69 |/* go ba|ck to di|
|00005bd0| 72 65 63 74 6f 72 79 20 | 66 72 6f 6d 20 77 68 69 |rectory |from whi|
|00005be0| 63 68 20 73 74 61 72 74 | 65 64 20 2a 2f 0a 58 09 |ch start|ed */.X.|
|00005bf0| 63 6c 6f 73 65 64 69 72 | 28 44 49 52 50 29 3b 09 |closedir|(DIRP);.|
|00005c00| 2f 2a 20 63 6c 6f 73 65 | 20 74 68 65 20 6f 6e 65 |/* close| the one|
|00005c10| 20 77 65 20 77 65 72 65 | 20 63 61 6e 6e 69 6e 67 | we were| canning|
|00005c20| 20 2a 2f 0a 58 09 2f 2a | 20 6d 61 6b 65 20 73 75 | */.X./*| make su|
|00005c30| 72 65 20 74 68 65 79 20 | 77 61 6e 74 20 74 6f 20 |re they |want to |
|00005c40| 67 65 74 20 72 69 64 20 | 6f 66 20 74 68 65 20 64 |get rid |of the d|
|00005c50| 69 72 65 63 74 6f 72 79 | 20 2a 2f 0a 58 09 69 66 |irectory| */.X.if|
|00005c60| 28 49 4e 54 45 52 41 43 | 54 49 56 45 20 21 3d 20 |(INTERAC|TIVE != |
|00005c70| 30 29 0a 58 09 7b 0a 58 | 09 09 66 70 72 69 6e 74 |0).X.{.X|..fprint|
|00005c80| 66 28 73 74 64 6f 75 74 | 2c 20 22 63 61 6e 20 64 |f(stdout|, "can d|
|00005c90| 69 72 65 63 74 6f 72 79 | 20 25 73 5c 3f 20 22 2c |irectory| %s\? ",|
|00005ca0| 20 74 65 6d 70 29 3b 0a | 58 09 09 66 73 63 61 6e | temp);.|X..fscan|
|00005cb0| 66 28 73 74 64 69 6e 2c | 20 22 25 73 22 2c 20 41 |f(stdin,| "%s", A|
|00005cc0| 4e 53 57 45 52 29 3b 0a | 58 09 09 69 66 28 28 41 |NSWER);.|X..if((A|
|00005cd0| 4e 53 57 45 52 5b 30 5d | 20 21 3d 20 27 79 27 29 |NSWER[0]| != 'y')|
|00005ce0| 20 26 26 20 28 41 4e 53 | 57 45 52 5b 30 5d 20 21 | && (ANS|WER[0] !|
|00005cf0| 3d 20 27 59 27 29 29 0a | 58 09 09 09 72 65 74 75 |= 'Y')).|X...retu|
|00005d00| 72 6e 3b 0a 58 09 7d 0a | 58 09 2f 2a 20 67 65 74 |rn;.X.}.|X./* get|
|00005d10| 20 72 69 64 20 6f 66 20 | 74 68 65 20 64 69 72 65 | rid of |the dire|
|00005d20| 63 74 6f 72 79 20 2a 2f | 0a 58 09 69 66 28 72 6d |ctory */|.X.if(rm|
|00005d30| 64 69 72 28 74 65 6d 70 | 29 20 21 3d 20 30 29 0a |dir(temp|) != 0).|
|00005d40| 58 09 09 70 65 72 72 6f | 72 28 22 63 61 6e 31 31 |X..perro|r("can11|
|00005d50| 22 29 3b 0a 58 09 65 6c | 73 65 0a 58 09 09 2f 2a |");.X.el|se.X../*|
|00005d60| 20 74 65 6c 6c 20 74 68 | 65 6d 20 69 66 20 74 68 | tell th|em if th|
|00005d70| 65 79 20 77 61 6e 74 20 | 74 6f 20 6b 6e 6f 77 20 |ey want |to know |
|00005d80| 2a 2f 0a 58 09 09 69 66 | 28 56 45 52 42 4f 53 45 |*/.X..if|(VERBOSE|
|00005d90| 29 0a 58 09 09 09 66 70 | 72 69 6e 74 66 28 73 74 |).X...fp|rintf(st|
|00005da0| 64 6f 75 74 2c 20 22 25 | 73 3a 20 63 61 6e 6e 65 |dout, "%|s: canne|
|00005db0| 64 20 64 69 72 65 63 74 | 6f 72 79 5c 6e 22 2c 20 |d direct|ory\n", |
|00005dc0| 74 65 6d 70 29 3b 0a 58 | 7d 0a 45 4e 44 5f 4f 46 |temp);.X|}.END_OF|
|00005dd0| 5f 46 49 4c 45 0a 69 66 | 20 74 65 73 74 20 33 34 |_FILE.if| test 34|
|00005de0| 36 30 20 2d 6e 65 20 60 | 77 63 20 2d 63 20 3c 27 |60 -ne `|wc -c <'|
|00005df0| 72 65 63 75 72 63 61 6e | 2e 63 27 60 3b 20 74 68 |recurcan|.c'`; th|
|00005e00| 65 6e 0a 20 20 20 20 65 | 63 68 6f 20 73 68 61 72 |en. e|cho shar|
|00005e10| 3a 20 5c 22 27 72 65 63 | 75 72 63 61 6e 2e 63 27 |: \"'rec|urcan.c'|
|00005e20| 5c 22 20 75 6e 70 61 63 | 6b 65 64 20 77 69 74 68 |\" unpac|ked with|
|00005e30| 20 77 72 6f 6e 67 20 73 | 69 7a 65 21 0a 66 69 0a | wrong s|ize!.fi.|
|00005e40| 23 20 65 6e 64 20 6f 66 | 20 27 72 65 63 75 72 63 |# end of| 'recurc|
|00005e50| 61 6e 2e 63 27 0a 66 69 | 0a 69 66 20 74 65 73 74 |an.c'.fi|.if test|
|00005e60| 20 2d 66 20 27 78 64 65 | 76 63 61 6e 2e 63 27 20 | -f 'xde|vcan.c' |
|00005e70| 2d 61 20 22 24 7b 31 7d | 22 20 21 3d 20 22 2d 63 |-a "${1}|" != "-c|
|00005e80| 22 20 3b 20 74 68 65 6e | 20 0a 20 20 65 63 68 6f |" ; then| . echo|
|00005e90| 20 73 68 61 72 3a 20 57 | 69 6c 6c 20 6e 6f 74 20 | shar: W|ill not |
|00005ea0| 63 6c 6f 62 62 65 72 20 | 65 78 69 73 74 69 6e 67 |clobber |existing|
|00005eb0| 20 66 69 6c 65 20 5c 22 | 27 78 64 65 76 63 61 6e | file \"|'xdevcan|
|00005ec0| 2e 63 27 5c 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |.c'\".el|se.echo |
|00005ed0| 73 68 61 72 3a 20 45 78 | 74 72 61 63 74 69 6e 67 |shar: Ex|tracting|
|00005ee0| 20 5c 22 27 78 64 65 76 | 63 61 6e 2e 63 27 5c 22 | \"'xdev|can.c'\"|
|00005ef0| 20 5c 28 31 36 36 34 20 | 63 68 61 72 61 63 74 65 | \(1664 |characte|
|00005f00| 72 73 5c 29 0a 73 65 64 | 20 22 73 2f 5e 58 2f 2f |rs\).sed| "s/^X//|
|00005f10| 22 20 3e 27 78 64 65 76 | 63 61 6e 2e 63 27 20 3c |" >'xdev|can.c' <|
|00005f20| 3c 27 45 4e 44 5f 4f 46 | 5f 46 49 4c 45 27 0a 58 |<'END_OF|_FILE'.X|
|00005f30| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00005f40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005f50| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005f60| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00005f70| 2a 2a 2a 2a 2a 2a 2a 2a | 0a 58 2a 0a 58 2a 09 58 |********|.X*.X*.X|
|00005f80| 44 45 56 43 41 4e 2e 43 | 0a 58 2a 09 09 74 68 69 |DEVCAN.C|.X*..thi|
|00005f90| 73 20 69 73 20 63 61 6c | 6c 65 64 20 61 6e 64 20 |s is cal|led and |
|00005fa0| 74 68 65 20 66 69 6c 65 | 20 69 73 20 63 6f 70 69 |the file| is copi|
|00005fb0| 65 64 20 76 69 61 20 72 | 65 61 64 20 61 6e 64 20 |ed via r|ead and |
|00005fc0| 77 72 69 74 65 20 74 6f | 20 0a 58 2a 09 09 74 68 |write to| .X*..th|
|00005fd0| 65 20 6f 74 68 65 72 20 | 64 65 76 69 63 65 2c 20 |e other |device, |
|00005fe0| 73 75 72 65 20 69 74 20 | 6d 61 79 20 62 65 20 73 |sure it |may be s|
|00005ff0| 6c 6f 77 20 62 75 74 20 | 69 74 20 73 6f 6c 76 65 |low but |it solve|
|00006000| 73 20 61 20 70 72 6f 62 | 6c 65 6d 20 0a 58 2a 09 |s a prob|lem .X*.|
|00006010| 09 6f 66 20 63 72 6f 73 | 73 20 64 65 76 69 63 65 |.of cros|s device|
|00006020| 20 6c 69 6e 6b 73 20 63 | 72 6f 73 73 64 65 76 63 | links c|rossdevc|
|00006030| 61 6e 28 4f 4c 44 46 49 | 4c 45 2c 20 4e 45 57 46 |an(OLDFI|LE, NEWF|
|00006040| 49 4c 45 29 0a 58 2a 0a | 58 2a 2a 2a 2a 2a 2a 2a |ILE).X*.|X*******|
|00006050| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00006060| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00006070| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00006080| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00006090| 2f 0a 58 0a 58 23 69 6e | 63 6c 75 64 65 20 22 63 |/.X.X#in|clude "c|
|000060a0| 61 6e 2e 68 22 0a 58 0a | 58 63 72 6f 73 73 64 65 |an.h".X.|Xcrossde|
|000060b0| 76 63 61 6e 28 4f 4c 44 | 46 49 4c 45 2c 20 4e 45 |vcan(OLD|FILE, NE|
|000060c0| 57 46 49 4c 45 29 0a 58 | 63 68 61 72 20 2a 4f 4c |WFILE).X|char *OL|
|000060d0| 44 46 49 4c 45 2c 20 2a | 4e 45 57 46 49 4c 45 3b |DFILE, *|NEWFILE;|
|000060e0| 0a 58 7b 0a 58 09 69 6e | 74 20 6f 6c 64 46 44 2c |.X{.X.in|t oldFD,|
|000060f0| 20 6e 65 77 46 44 3b 09 | 2f 2a 20 46 69 6c 65 20 | newFD;.|/* File |
|00006100| 44 65 73 63 72 69 70 74 | 6f 72 73 20 66 6f 72 20 |Descript|ors for |
|00006110| 61 63 63 65 73 73 20 2a | 2f 0a 58 09 63 68 61 72 |access *|/.X.char|
|00006120| 20 4e 45 58 54 43 48 41 | 52 5b 35 31 32 5d 3b 09 | NEXTCHA|R[512];.|
|00006130| 2f 2a 20 75 73 65 64 20 | 74 6f 20 74 72 61 6e 73 |/* used |to trans|
|00006140| 66 65 72 20 74 68 65 20 | 63 68 61 72 20 74 6f 20 |fer the |char to |
|00006150| 6e 65 77 20 70 6c 61 63 | 65 20 2a 2f 0a 58 09 69 |new plac|e */.X.i|
|00006160| 6e 74 20 52 57 53 49 5a | 45 20 3d 20 35 31 32 3b |nt RWSIZ|E = 512;|
|00006170| 09 2f 2a 20 61 6d 6f 75 | 6e 74 20 74 6f 20 72 65 |./* amou|nt to re|
|00006180| 61 64 20 61 6e 64 20 77 | 72 69 74 65 20 2a 2f 0a |ad and w|rite */.|
|00006190| 58 09 73 74 72 75 63 74 | 20 73 74 61 74 20 42 55 |X.struct| stat BU|
|000061a0| 46 3b 09 2f 2a 20 75 73 | 65 64 20 74 6f 20 74 72 |F;./* us|ed to tr|
|000061b0| 61 6e 73 66 65 72 20 61 | 6c 6c 20 73 74 61 74 73 |ansfer a|ll stats|
|000061c0| 20 6f 66 20 6f 6c 64 20 | 66 69 6c 65 20 74 6f 20 | of old |file to |
|000061d0| 6e 65 77 20 2a 2f 0a 58 | 09 69 6e 74 20 6e 5f 72 |new */.X|.int n_r|
|000061e0| 65 61 64 3b 09 2f 2a 20 | 74 68 65 20 6e 75 6d 62 |ead;./* |the numb|
|000061f0| 65 72 20 6f 66 20 62 79 | 74 65 73 20 73 75 63 63 |er of by|tes succ|
|00006200| 65 73 73 66 75 6c 6c 79 | 20 72 65 61 64 20 2a 2f |essfully| read */|
|00006210| 0a 58 0a 58 09 2f 2a 20 | 63 72 65 61 74 65 20 74 |.X.X./* |create t|
|00006220| 68 65 20 6e 65 77 20 66 | 69 6c 65 20 69 6e 20 74 |he new f|ile in t|
|00006230| 68 65 20 74 72 61 73 68 | 63 61 6e 20 2a 2f 0a 58 |he trash|can */.X|
|00006240| 09 69 66 28 28 6e 65 77 | 46 44 20 3d 20 63 72 65 |.if((new|FD = cre|
|00006250| 61 74 28 4e 45 57 46 49 | 4c 45 2c 20 30 30 37 37 |at(NEWFI|LE, 0077|
|00006260| 37 29 29 20 3c 20 30 29 | 0a 58 09 7b 0a 58 09 09 |7)) < 0)|.X.{.X..|
|00006270| 70 65 72 72 6f 72 28 22 | 43 72 6f 73 73 20 44 65 |perror("|Cross De|
|00006280| 76 69 63 65 20 63 61 6e | 22 29 3b 0a 58 09 09 72 |vice can|");.X..r|
|00006290| 65 74 75 72 6e 3b 0a 58 | 09 7d 0a 58 09 2f 2a 20 |eturn;.X|.}.X./* |
|000062a0| 6f 70 65 6e 20 74 68 65 | 20 6f 6c 64 20 6f 6e 65 |open the| old one|
|000062b0| 20 74 6f 20 62 65 20 72 | 65 61 64 20 2a 2f 0a 58 | to be r|ead */.X|
|000062c0| 09 69 66 28 28 6f 6c 64 | 46 44 20 3d 20 6f 70 65 |.if((old|FD = ope|
|000062d0| 6e 28 4f 4c 44 46 49 4c | 45 2c 20 4f 5f 52 44 4f |n(OLDFIL|E, O_RDO|
|000062e0| 4e 4c 59 29 29 20 3c 20 | 30 29 0a 58 09 7b 0a 58 |NLY)) < |0).X.{.X|
|000062f0| 09 09 70 65 72 72 6f 72 | 28 22 43 72 6f 73 73 20 |..perror|("Cross |
|00006300| 44 65 76 69 63 65 20 63 | 61 6e 22 29 3b 0a 58 09 |Device c|an");.X.|
|00006310| 09 72 65 74 75 72 6e 3b | 0a 58 09 7d 0a 58 09 2f |.return;|.X.}.X./|
|00006320| 2a 20 72 65 70 65 61 74 | 65 64 6c 79 20 72 65 61 |* repeat|edly rea|
|00006330| 64 20 61 6e 64 20 77 72 | 69 74 65 20 75 6e 74 69 |d and wr|ite unti|
|00006340| 6c 20 77 68 6f 6c 65 20 | 66 69 6c 65 20 69 73 20 |l whole |file is |
|00006350| 63 6f 70 69 65 64 20 2a | 2f 0a 58 09 77 68 69 6c |copied *|/.X.whil|
|00006360| 65 28 28 6e 5f 72 65 61 | 64 20 3d 20 72 65 61 64 |e((n_rea|d = read|
|00006370| 28 6f 6c 64 46 44 2c 20 | 4e 45 58 54 43 48 41 52 |(oldFD, |NEXTCHAR|
|00006380| 2c 20 52 57 53 49 5a 45 | 29 29 20 21 3d 20 30 29 |, RWSIZE|)) != 0)|
|00006390| 0a 58 09 7b 0a 58 09 09 | 69 66 28 28 77 72 69 74 |.X.{.X..|if((writ|
|000063a0| 65 28 6e 65 77 46 44 2c | 20 4e 45 58 54 43 48 41 |e(newFD,| NEXTCHA|
|000063b0| 52 2c 20 6e 5f 72 65 61 | 64 29 29 20 21 3d 20 6e |R, n_rea|d)) != n|
|000063c0| 5f 72 65 61 64 29 0a 58 | 09 09 7b 0a 58 09 09 09 |_read).X|..{.X...|
|000063d0| 70 65 72 72 6f 72 28 22 | 43 72 6f 73 73 20 44 65 |perror("|Cross De|
|000063e0| 76 69 63 65 20 63 61 6e | 22 29 3b 0a 58 09 09 09 |vice can|");.X...|
|000063f0| 72 65 74 75 72 6e 3b 0a | 58 09 09 7d 0a 58 09 7d |return;.|X..}.X.}|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.