Return-Path: Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: (qmail 73735 invoked from network); 12 Nov 2010 02:30:07 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Nov 2010 02:30:07 -0000 Received: (qmail 55339 invoked by uid 500); 12 Nov 2010 02:30:32 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 55302 invoked by uid 500); 12 Nov 2010 02:30:32 -0000 Mailing-List: contact common-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-user@hadoop.apache.org Delivered-To: mailing list common-user@hadoop.apache.org Received: (qmail 55287 invoked by uid 99); 12 Nov 2010 02:30:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Nov 2010 02:30:32 +0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=FREEMAIL_FROM,HK_RANDOM_ENVFROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zjffdu@gmail.com designates 209.85.161.48 as permitted sender) Received: from [209.85.161.48] (HELO mail-fx0-f48.google.com) (209.85.161.48) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Nov 2010 02:30:27 +0000 Received: by fxm10 with SMTP id 10so1581830fxm.35 for ; Thu, 11 Nov 2010 18:30:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ivNoVihMYNSx6dXGqH5IL+oVnydfY8GjG17AfOdCbA4=; b=Or6+icA97feM51Iv7TF4FO+f7LA5YAs5tNI/oGYECND0q0ahlwblE6ag09LNJ3j4Lx 4TW0gZ6IJ8PJwLpq4UcCt1Vq3zYaxE6zSmdty1l0tuL6k2JxvbDhcUOgbs/W29xA2P6F cVJm6yIGDkB6GDkbiVo+DF7xS2cwpInzUmoGw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=aR4Pch43QgMCISBjNeswo5KgeBJVpD4OOHubzf/DXrM5yBfYuCUyufo80E+OvwvRvQ SBaMsn56cbbq3kX7jc2oDMkChGIV2tzgNTMD42fhpDlKURPnxSuknT/H1t6N+UUGgOSS eeAGaOMjtifwcsJ8r82AJzkH1hyh+kYaJ2kmU= MIME-Version: 1.0 Received: by 10.223.72.198 with SMTP id n6mr856348faj.125.1289529005923; Thu, 11 Nov 2010 18:30:05 -0800 (PST) Received: by 10.223.74.137 with HTTP; Thu, 11 Nov 2010 18:30:05 -0800 (PST) In-Reply-To: <30195698.post@talk.nabble.com> References: <30195698.post@talk.nabble.com> Date: Fri, 12 Nov 2010 10:30:05 +0800 Message-ID: Subject: Re: how to perform dfs -ls as a request from www From: Jeff Zhang To: common-user@hadoop.apache.org Cc: core-user@hadoop.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable If you are using Java Servlet, then you can use HDFS Java API directly. Use FileSystem.listStatus instead of call shell, and put core-site.xml hdfs-site.xml on your classpath. If you are using other programming language, maybe you can try HDFS's thrift interface On Fri, Nov 12, 2010 at 9:33 AM, sudharshan wrote: > > My question might be a numb but this is where I am stuck now please bear = with > me . Basically I want to execute bin/hadoop dfs -ls when a user in a web > page clicks a button and displays 0 if the command is executed successful= ly > and -1 if not executed. I have a script which runs when the user clicks t= he > button in the web page. The script contains a system call of > system(bin/hadoop dfs -ls) . But it is not been executed due to file > permission of hdfs when issued from www. > After googling I came to know that hdfs executes commands by identifying = the > user only as a superuser. I tried to change the posix permissions of hdfs > but it took no effect. =C2=A0So can some one help me out? > Thanks > -- > View this message in context: http://old.nabble.com/how-to-perform-dfs--l= s-as-a-request-from-www-tp30195698p30195698.html > Sent from the Hadoop core-user mailing list archive at Nabble.com. > > --=20 Best Regards Jeff Zhang