vsi_rmdir {gdalraster}R Documentation

Delete a directory

Description

vsi_rmdir() deletes a directory object from the file system. On some systems the directory must be empty before it can be deleted. This function goes through the GDAL VSIFileHandler virtualization and may work on unusual filesystems such as in memory. It is a wrapper for VSIRmdir() in the GDAL Common Portability Library. Analog of the POSIX rmdir() function.

Usage

vsi_rmdir(path)

Arguments

path

Character string. The path to the directory to be deleted.

Value

Invisibly, 0 on success or -1 on an error.

See Also

deleteDataset(), vsi_mkdir(), vsi_read_dir(), vsi_unlink()

Examples

# for illustration only
# this would normally be used with GDAL virtual file systems
new_dir <- file.path(tempdir(), "newdir")
result <- vsi_mkdir(new_dir)
print(result)
result <- vsi_rmdir(new_dir)
print(result)

[Package gdalraster version 1.10.0 Index]