Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4891ED552 for ; Wed, 5 Sep 2012 13:57:32 +0000 (UTC) Received: (qmail 43396 invoked by uid 500); 5 Sep 2012 13:57:27 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 43299 invoked by uid 500); 5 Sep 2012 13:57:27 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 43291 invoked by uid 99); 5 Sep 2012 13:57:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 13:57:27 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of airbots@gmail.com designates 209.85.212.48 as permitted sender) Received: from [209.85.212.48] (HELO mail-vb0-f48.google.com) (209.85.212.48) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 13:57:20 +0000 Received: by vbme21 with SMTP id e21so145226vbm.35 for ; Wed, 05 Sep 2012 06:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=AQFTCL3J5DTfTBAiuIrDRfv7Y5lcIXEx0JnJrSsElm8=; b=UAGKRU25bNysgpKVBh8rpvXAgaFDNsF66MPbAir6XcK2PfMsAzp9lw53a01TB5a2AJ UOaSr6La2LkpUXnQ9tIObjad+W/YxugwI8Ri1L717DsOIP4LTvv/+o3R73qSu9hHAr7P X68uLgNR6ir7RsB1IxCIyi81r9aftM7lUJUSGE37k9c9qNZ8MR8mtF2zAl5VAT7GLf4h A31GnD8wm60i5exPO4D4cBOAf7znQZwJDp3YH6f/X8HU65oTUQC/fE9L/TubIHN2MkNo +wC6+vFo3uEF3vQWhsaen+U4T0jPpbwgOfS758cPY0/t4/NUSK3JyWPK0OnAImJR79vY 3WDg== MIME-Version: 1.0 Received: by 10.52.99.135 with SMTP id eq7mr14778036vdb.8.1346853419909; Wed, 05 Sep 2012 06:56:59 -0700 (PDT) Received: by 10.58.147.10 with HTTP; Wed, 5 Sep 2012 06:56:59 -0700 (PDT) In-Reply-To: References: Date: Wed, 5 Sep 2012 08:56:59 -0500 Message-ID: Subject: Re: directory delete in hadoop From: Chen He To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=bcaec5016135a8823604c8f4bfcd --bcaec5016135a8823604c8f4bfcd Content-Type: text/plain; charset=ISO-8859-1 you have to include the hdfs-site.xml and hdfs-default.xml. Because those two files tell you where is the namenode and what is the operation port. On Wed, Sep 5, 2012 at 6:47 AM, Harsh J wrote: > Yes, if you delete a directory, its contents are recursively deleted. > If you do not want that to happen (i.e. you want a protective > measure), use > http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/fs/FileSystem.html#delete(org.apache.hadoop.fs.Path,%20boolean) > with false. And it will never delete a directory. > > Sort of like rm vs. rm -r on *nix. > > On Wed, Sep 5, 2012 at 4:44 PM, nisha sharma > wrote: > > Hi, > > > > I m usin the below method to delete a directory named testingfolder, will > > this method delete all my jpeg files inside this directory will these > files > > also get deleted from hdfs along with the directory > > > > fileSystem.delete( > > new Path("/user/testingfolder"),true); > > > > -- > Harsh J > --bcaec5016135a8823604c8f4bfcd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable you have to include the hdfs-site.xml and hdfs-default.xml. Because those t= wo files tell you where is the namenode and what is the operation port.
=
On Wed, Sep 5, 2012 at 6:47 AM, Harsh J <h= arsh@cloudera.com> wrote:
Yes, if you delete a directory, its contents= are recursively deleted.
If you do not want that to happen (i.e. you want a protective
measure), use http://hadoop.apache.org/common/docs/current/api/o= rg/apache/hadoop/fs/FileSystem.html#delete(org.apache.hadoop.fs.Path,%20boo= lean)
with false. And it will never delete a directory.

Sort of like rm vs. rm -r on *nix.

On Wed, Sep 5, 2012 at 4:44 PM, nisha sharma <nishakulkarni89@gmail.com> wrote:
> Hi,
>
> I m usin the below method to delete a directory named testingfolder, w= ill
> this method delete all my jpeg files inside this directory will these = files
> also get deleted from hdfs along with the directory
>
> fileSystem.delete(
> new Path("/user/testingfolder"),true);



--
Harsh J

--bcaec5016135a8823604c8f4bfcd--