vsi_mkdir {gdalraster}R Documentation

Create a directory

Description

vsi_mkdir() creates a new directory with the indicated mode. For POSIX-style systems, the mode is modified by the file creation mask (umask). However, some file systems and platforms may not use umask, or they may ignore the mode completely. So a reasonable cross-platform default mode value is 0755. This function is a wrapper for VSIMkdir() in the GDAL Common Portability Library. Analog of the POSIX mkdir() function.

Usage

vsi_mkdir(path, mode = 755L)

Arguments

path

Character string. The path to the directory to create.

mode

Integer scalar. The permissions mode.

Value

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

See Also

vsi_read_dir(), vsi_rmdir()

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]