1. length(from) != 1: Error: Only one file can be copied.
2. file.exists(from)? If no, If no, return FALSE.
3. if(missing(to))to <- from; else if(length(to)!=1) error.
4. file.exists(to)? If yes, Dir <- dir(dirname(to)), find all
Dir
starting with to
, and find the smallest integer to
append to make a unique to
name.
5. file.copy(from, to)
6. Return TRUE.