Learn R Programming

gdalraster (version 1.11.1)

vsi_read_dir: Read names in a directory

Description

vsi_read_dir() abstracts access to directory contents. It returns a character vector containing the names of files and directories in this directory. This function is a wrapper for VSIReadDirEx() in the GDAL Common Portability Library.

Usage

vsi_read_dir(path, max_files = 0L)

Value

A character vector containing the names of files and directories in the directory given by path. An empty string ("") is returned if path does not exist.

Arguments

path

Character string. The relative or absolute path of a directory to read.

max_files

Integer scalar. The maximum number of files after which to stop, or 0 for no limit (see Note).

See Also

vsi_mkdir(), vsi_rmdir(), vsi_stat(), vsi_sync()

Examples

Run this code
# regular file system for illustration
data_dir <- system.file("extdata", package="gdalraster")
vsi_read_dir(data_dir)

Run the code above in your browser using DataLab