
Starting Out on the Wrong Foot 21
38
39 if (in_file.bad())
40 {
41 std::cerr <<
42 "Error: Unable to open input file\n";
43 exit (8);
44 }
45
46 if (out_file.bad())
47 {
48 std::cerr <<
49 "Error: Unable to open output file\n";
50 exit (8);
51 }
52
53 while (! in_file.eof())
54 {
55 // The original program output
56 // a block header here
57 send_block(in_file, out_file);
58 // The original program output a block
59 // trailer here. It also checked for
60 // a response and resent the block
61 // on error
62 }
63 return (0);
64 }
(Next Hint 183. Answer 65.)
One system administrator makes a habit of announcing that an upgrade
has been installed at least two weeks before