Skip to contents

This is the equivalent to dir.create(), but creating a collection in iRODS instead of a local directory.

Usage

imkdir(
  logical_path,
  create_parent_collections = FALSE,
  overwrite = FALSE,
  verbose = FALSE
)

Arguments

logical_path

Path to the collection to create, relative to the current working directory (see ipwd()).

create_parent_collections

Whether parent collections should be created when necessary. Defaults to FALSE.

overwrite

Whether the existing collection should be overwritten if it exists. Defaults to FALSE.

verbose

Whether information about the HTTP request and response should be printed. Defaults to FALSE.

Value

Invisibly the HTTP request.

See also

irm() for removing collections, dir.create() for an R equivalent.

Examples

is_irods_demo_running()
#> [1] TRUE
# \dontshow{
.old_config_dir <- Sys.getenv("R_USER_CONFIG_DIR")
Sys.setenv("R_USER_CONFIG_DIR" = tempdir())
# }
# connect project to server
create_irods("http://localhost:9001/irods-http-api/0.2.0", overwrite = TRUE)

# authentication
iauth("rods", "rods")

# list all object and collection in the current collection of iRODS
ils()
#> This collection does not contain any objects or collections.

# create a new collection
imkdir("new_collection")

# check if it is there
ils()
#> 
#> ==========
#> iRODS Zone
#> ==========
#>                        logical_path
#>  /tempZone/home/rods/new_collection

# and move to the new directory
icd("new_collection")

# remove collection
icd("..")
irm("new_collection", force = TRUE, recursive = TRUE)
# \dontshow{
Sys.setenv("R_USER_CONFIG_DIR" = .old_config_dir)
# }