Andy Isaacson 2012-10-22, 21:57
-Re: What is the command to see if a file is a directory or not in HDFS from bash?
BTW, while verifying this behavior I noticed that there is a bug in
Hadoop 2.0 "dfs -test -d", it generates error messages when it should
be silent. I filed the bug at
On Mon, Oct 22, 2012 at 2:57 PM, Andy Isaacson <[EMAIL PROTECTED]> wrote:
> The result is reported in the shell exit code, not as a textual output
> from the command, just like the UNIX /usr/bin/test command.
> The intended use case is something like the following Bourne/bash shell example:
> if test -d /opt; then
> ... install in /opt
> ... install in /usr
> or using the /usr/bin/[ synonym available on most systems,
> if [ -d /opt ]; then ...
> if hadoop dfs -test -e something.txt; then
> echo "something.txt exists on hdfs"
> echo "something.txt does not exist on hdfs"
> On Mon, Oct 22, 2012 at 2:09 AM, Pedro Sá da Costa <[EMAIL PROTECTED]> wrote:
>> I execute 'hadoop-1.0.3/bin/hadoop dfs -test -d
>> /user/xeon/gutenberg/A.txt' command in the bash, and I was expecting
>> getting the value 0 or 1, but I got nothing.
>> What is the command to launch from the bash that allows to check if a
>> file in HDFS is a file or directory?
>> Best regards,