hdfs.rm

Removes a file or directory from HDFS.

Usage

hdfs.rm(
        dfs.id,
        force)

Arguments

dfs.id

The name of a file or directory in HDFS. The name can include a path that is either absolute or relative to the current path.

force

Controls whether a directory that contains files is deleted. Set to TRUE to delete the directory and all its files, or FALSE to cancel the operation (default).

Usage Notes

All object identifiers in Hadoop pointing to this data are invalid after this operation.

Return Value

TRUE if the data is deleted, or FALSE if the operation failed

Example

This example removes the file named data1.log in the current working HDFS directory:

R> hdfs.rm("data1.log")
[1] TRUE