Specifying Paths to Files and Directories

Many of the APIs require clients to pass a path to a file or directory. You can specify absolute paths or relative paths. Absolute paths must begin with a forward slash. Relative paths are relative to the working directory, which you can set by calling hdfsSetWorkingDirectory() and find out by calling hdfsGetWorkingDirectory(). Any path that does not begin with a forward slash is considered to be relative to the working directory.

The maximum length of paths is 4096 bytes.

You cannot specify paths to a cluster other than the cluster for the current connection. All paths are local to the cluster connected to. You can, however, explicitly connect to multiple clusters, as described in Establishing Connections to the File System.