[prev] 26 [next]

Exercise 1: Copying Files

Write two programs that
  • takes input file name F as argv[1]
  • checks for existence/readability of F
  • takes output file name G as argv[2]
  • opens file G for writing (truncate)
  • copies the content of F into G
Implement them using:
  • character-by-character input/output
  • line-by-line input/output
  • read/write using large memory buffer