hdfsCreateDirectory2()

Supported by libMapRClient for hadoop-2.x

Makes the given file and all non-existent parents into directories. Stores the size of the name container in a location that you pass a pointer into, so that you can keep track of this size. The size is in bytes.

Keeping track of the size of the name container is useful when you are creating files that are less than or equal to 64 KB. When the size of all of the such files together for one name container exceeds 64 GB, operations on the name container can become inefficient. If the size of a name container reaches 64 GB, you can switch to a new or different volume.

Signature

int hdfsCreateDirectory2(hdfsFS fs, const char* path, tSize *nameSizeInBytes)

Parameters

Parameter Description
fs The handle of the file system in which to create the file or directory. Obtain this handle with one of the hdfsConnect() APIs.
path The path of the directory.
nameSizeInBytes A pointer to a memory buffer that can store the size in bytes of the name container.

Return Value

Returns 0 on success, -1 on error.

Check errno for error codes and meanings.