Description Usage Arguments Details Value Author(s) See Also Examples
Copy a file appending a number to make the to
name unique, with
default to
= from
.
1 | file.copy2(from, to)
|
from |
character: name of a file to be copied |
to |
character: name of copy. Default = |
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.
logical: TRUE (with a name = name of the file created); FALSE if no file created.
Spencer Graves
1 2 3 4 5 | ## Not run:
file.copy2('startup.m')
# Used by 'fdaMatlabPath' so an existing 'startup.m' is not destroyed
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.