This "copy" program demonstrates the use of interfaces, modules, and importing.
The source sources for the program are: Copy
,
FakeOS.i3
and FakeOS.m3
.
Read them to learn how to divide up your code into modules, and how to import
existing functionality by importing interfaces.
This copy program accepts the following syntax at the command line
% copy source destination
Note: When you build this package, you will notice that a number of warnings will appear. That's because this version of the copy command does not check for any possible runtime errors, or exceptions. To cause a run-time error, you can try copying a non-existent file, and see how the program will behave. Note how the compiler helps you to learn about all the possible sources of exception errors at compile-time.To learn about handling of errors, read on to the exception example.