Supported by libMaprClient for hadoop-0.20.2 and hadoop-2.x

Changes ownership of a file or directory in the manner of the chown command.

Signature

int hdfsChown(hdfsFS fs, const char* path, const char *owner, const char *group)

Parameters

fs

The handle to the filesystem. Obtain this handle with one of the hdfsConnect() APIs.

path

The path to the file or directory

owner

The user to own the file or directory. Set to NULL to keep the owner as is.

groupĀ 

The group to own the file or directory. Set to NULL to keep the owner as is.

Return Value

Returns 0 on success, -1 on error.

Check errno for error codes and meanings.

errno is set to EINVAL if the input arguments are invalid.

errno is set to EPERMĀ  if the process does not have enough privileges to perform the operation.