Program 16.6 illustrates a command-line tool to implement a simple file copy operation. Usage of this command is as follows:
copy from-file to-file
copyPath:toPath:handler: method, your command-line tool enables to-file to be a directory name. In that case, the file is copied into the to-file directory under the name from-file. Also unlike the method, if to-file already exists, you allow its contents to be overwritten. This is more in line with the standard UNIX copy command
You can get the filenames from the command line by using the
argv arguments to
main. These two arguments are populated, respectively, with the number of argument types on the command line ...