hdfs_exists()

Read(4704) Label: exist, hadoop,

Description:

Check whether there is a specified file or folder in HDFS and return a Boolean value.

Syntax:

hdfs_exists(hd,file/path)

Note:

The external library function (See External Library Guide) checks whether a file or a folder exists and returns a Boolean value.

Parameter:

hd

An hd connection.

file

Hadoop file name.

path

Hadoop path name.

Return value

Boolean

Example:

 

A

 

1

=hdfs_open("hdfs://192.168.0.76:9000")

Connect to HDFS file system.

2

=hdfs_exists(A1,"/user")

Check whether folder user exists.

3

=hdfs_exists(A1,"/user/emp.txt")

Check whether file emp.txt exists.

4

=hdfs_close(A1)