- Timestamp:
- Aug 17, 2024, 3:15:21 PM (3 months ago)
- Branches:
- master
- Children:
- df2e00f
- Parents:
- afb15cf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/.in/copyfile.txt
rafb15cf r3ac5fd8 10 10 // Created On : Fri Jun 19 13:44:05 2020 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 5 21:20:07 202313 // Update Count : 512 // Last Modified On : Sat Aug 17 14:18:47 2024 13 // Update Count : 11 14 14 // 15 15 … … 22 22 23 23 try { 24 choose ( argc ) { 25 case 2, 3:24 choose ( argc ) { // terminate if command-line errors 25 case 3, 2: 26 26 open( in, argv[1] ); // open input file first as output creates file 27 27 if ( argc == 3 ) open( out, argv[2] ); // do not create output unless input opens 28 28 case 1: ; // use default files 29 default: 29 default: // wrong number of options 30 30 exit | "Usage" | argv[0] | "[ input-file (default stdin) [ output-file (default stdout) ] ]"; 31 31 } // choose … … 41 41 42 42 char ch; 43 for () { // read all characters 44 in | ch; 45 if ( eof( in ) ) break; // eof ? 46 out | ch; 47 } //for 43 try { 44 for () { // read all characters 45 in | ch; 46 out | ch; 47 } // for 48 } catch( end_of_file * ) { 49 } // try 48 50 } // main 49 50 // Local Variables: //51 // tab-width: 4 //52 // compile-command: "cfa copyfile.cfa" //53 // End: //
Note: See TracChangeset
for help on using the changeset viewer.