December 2013
Beginner
576 pages
16h 4m
English
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
Unlike NSFileManager’s 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 cp.
You can get the filenames from the command line by using the argc and argv arguments to main. These two arguments are populated, respectively, with the number of argument types on the command line ...
Read now
Unlock full access