HDFql Reference Manual v2.6.0

6.4.1CREATE DIRECTORY

Syntax

CREATE [AND USE] DIRECTORY directory_name [, directory_name]*

Description

Create a directory named directory_name. Multiple directories can be created at once by separating their names with a comma (,). If directory_name already exists, it is not overwritten, no subsequent directories are created, and an error is raised. In case the keyword AND USE is specified, the directory is used (i.e. opened) after being successfully created (please refer to the operation USE DIRECTORY for additional information). In case directory_name includes intermediate directories that do not exist, they are created automatically along with directory_name (e.g. when creating the directory “my_directory/my_subdirectory/my_subsubdirectory”, in addition to “my_subsubdirectory” being created, “my_directory” and “my_subdirectory” are also created if they do not already exist).

Parameter(s)

directory_name – mandatory string that specifies the name of the directory to create. As a general rule, in case directory_name contains spaces or special characters, it should be enclosed in double quotes (“). Otherwise, if it is not enclosed in double quotes, the directory is not created, and an error is raised. This rule also applies to any other HDFql operation that works with directory names (e.g. RENAME DIRECTORY).

Return

Nothing

Example(s)

# create a directory named "my_directory0" (the directory will not be overwritten if it already exists)
CREATE DIRECTORY my_directory0

# create a directory named "my_directory1" in a root directory named "data" (neither directory will be overwritten if they already exist; directory "data" will be created automatically if it does not exist)
CREATE DIRECTORY /data/my_directory1

# create two directories named "my_directory2" and "my_directory3" (neither directory will be overwritten if they already exist)
CREATE DIRECTORY my_directory2, my_directory3

# create a directory named "this is a long directory name" (the directory will not be overwritten if it already exists) and use (i.e. open) it for subsequent operations
CREATE AND USE DIRECTORY "this is a long directory name"