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

Changes the access and modification times of a file or directory.


int hdfsUtime(hdfsFS fs, const char* path, tTime mtime, tTime atime)



The handle of the filesystem where the file or directory is located. Obtain this handle with one of the hdfsConnect() APIs.


The path to the file or directory.


The new modification time or 0 (if you want to set only the access time) in seconds.


The new access time or 0 (if you want to set only the modification time) in seconds.

Return Value

Returns 0 on success, -1 on error.

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.