Absolute.
The exists()
method tests if a file exists.
Do this when a program is about to create
a file and you don't want to destroy a previous file of the same name.
Let us improve the file copy program from the previous chapter so that it tests that: (1) the destination file does not already exist, and that (2) the source file does exist. A start on this program is above.
Fill in the blanks so the program works as described. Cut and paste the following phrases (some phrases may be used more than once):
exists() args[2] !