unlink deletes the file(s) or directories specified by
unlink(x, recursive = FALSE, force = FALSE, expand = TRUE)
a character vector with the names of the file(s) or directories to be deleted.
logical. Should directories be deleted recursively?
logical. Should permissions be changed (if possible) to allow the file or directory to be removed?
logical. Should wildcards (see ‘Details’ below) and
recursive = FALSE directories are not deleted,
not even empty ones.
On most platforms ‘file’ includes symbolic links, fifos and
unlink(x, recursive = TRUE)
deletes just the symbolic link if the target of such a link is a directory.
Wildcard expansion (normally ‘*’ and ‘?’ are allowed) is done by
the internal code of
Sys.glob. Wildcards never match a
leading ‘.’ in the filename, and files ‘.’, ‘..’ and
‘~’ will never be considered for deletion.
Wildcards will only be expanded if the system supports it. Most
systems will support not only ‘*’ and ‘?’ but also character
classes such as ‘[a-z]’ (see the
man pages for the system
glob on your OS). The metacharacters
* ? [ can
occur in Unix filenames, and this makes it difficult to use
unlink to delete such files (see
although escaping the metacharacters by backslashes usually works. If
a metacharacter matches nothing it is considered as a literal
recursive = TRUE might not be supported on all platforms, when it
will be ignored, with a warning: however there are no known current
0 for success,
1 for failure, invisibly.
Not deleting a non-existent file is not a failure, nor is being unable
to delete a directory if
recursive = FALSE. However, missing
x are regarded as failures.
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.