vsi_rmdir | R Documentation |
vsi_rmdir()
deletes a directory object from the file system. On some
systems the directory must be empty before it can be deleted.
With recursive = TRUE
, deletes a directory object and its content from
the file system.
This function goes through the GDAL VSIFileHandler
virtualization and may
work on unusual filesystems such as in memory.
It is a wrapper for VSIRmdir()
and VSIRmdirRecursive()
in the GDAL
Common Portability Library.
vsi_rmdir(path, recursive = FALSE)
path |
Character string. The path to the directory to be deleted. |
recursive |
Logical scalar. |
0
on success or -1
on an error.
/vsis3/ has an efficient implementation for deleting recursively. Starting with GDAL 3.4, /vsigs/ has an efficient implementation for deleting recursively, provided that OAuth2 authentication is used.
deleteDataset()
, vsi_mkdir()
, vsi_read_dir()
, vsi_unlink()
new_dir <- file.path(tempdir(), "newdir")
vsi_mkdir(new_dir)
vsi_rmdir(new_dir)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.