hdfs判断文件是否存在
2016-10-27 16:08
399 查看
hadoop判断文件是否存在
在shell中判断一个HDFS目录/文件是否存在
直接看shell代码:
hadoop fs -test -e /hdfs_dir
if [ $? -ne 0 ]; then
echo "Directory not exists!"
fi
hadoop fs -test -e 用于判断HDFS目录/文件是否存在,下一步检测该命令的返回值,以确定其判断结果。
-test -[ezd] <path>: If file { exists, has zero length, is a directory
then return 0, else return 1.
e,z,d参数必用其一,不可缺少。
在shell中判断一个HDFS目录/文件是否存在
直接看shell代码:
hadoop fs -test -e /hdfs_dir
if [ $? -ne 0 ]; then
echo "Directory not exists!"
fi
hadoop fs -test -e 用于判断HDFS目录/文件是否存在,下一步检测该命令的返回值,以确定其判断结果。
-test -[ezd] <path>: If file { exists, has zero length, is a directory
then return 0, else return 1.
e,z,d参数必用其一,不可缺少。
相关文章推荐
- shell判断hdfs文件目录是否存在
- 脚本判断hdfs上的文件是否存在
- Shell脚本执行hive语句 | hive以日期建立分区表 | linux schedule程序 | sed替换文件字符串 | shell判断hdfs文件目录是否存在
- shell判断hdfs文件目录是否存在
- Hadoop——判断hdfs上文件是否存在
- 如何判断一个文件或目录是否存在
- 上传文件时判断文件夹是否存在
- 判断是否有文件存在
- 用commons-net ftpclient 怎么判断服务器是否存在文件A??
- 判断文件或文件夹是否存在
- VB之Win32 API编程--判断本地或远程文件是否存在的简易方法
- 通过URL判断文件是否有存在
- C/C++中判断某一文件或目录是否存在
- 判断远程文件是否存在的php函数
- 几个C#编程的小技巧 (二) (判断文件或文件夹是否存在 )
- VB中如何判断文件、文件夹是否存在
- 判断文件是否存在
- 写了两个判断文件目录是否存在的函数
- 在Visual foxpro 中判断文件是否存在的函数
- VC中判断目录,文件是否存在,创建目录的方法