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 D194DD285 for ; Wed, 5 Sep 2012 11:48:09 +0000 (UTC) Received: (qmail 25044 invoked by uid 500); 5 Sep 2012 11:48:05 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 24401 invoked by uid 500); 5 Sep 2012 11:48:04 -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 24360 invoked by uid 99); 5 Sep 2012 11:48:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 11:48:03 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of harsh@cloudera.com designates 209.85.223.176 as permitted sender) Received: from [209.85.223.176] (HELO mail-ie0-f176.google.com) (209.85.223.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 11:47:56 +0000 Received: by iecs9 with SMTP id s9so991955iec.35 for ; Wed, 05 Sep 2012 04:47:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=ZQrtiF6JPzLqklAgjeIVz+HZ/Nac/h6FMyLYhS6B4Jo=; b=nuOmh9PsOsaLrFgJo+Jn0maYCM4Q+/xtHvZSPuo0ZIZN2Cv+4OK+hhSmZ/KR0ivsYi ta7EdzviHdUXjJHlKLyiA3KNqp0pKoR2PSbm5Gitu0EASunznoA8OeyNJ+TnAvGgXwSo Etlcs8CMNBIWq9u1HH5rqfAnklIhpkk3XQ33CCAjLs4Cx4pjNeIsutUn0eKTaTuaIzwN eqtY9KVwezstmvYBqIHlK/KXBHQ1n7qXh9pU2WXK0nqAFnqQCbZcnWy3Wz9VEG/0AelA 5TokxcyEEzSZntFv6/amGI9M9HVmS4KbwDDqVHwcXvchqyq3p3+zr4nrCzhKtMxaj4dz aEpg== Received: by 10.60.9.134 with SMTP id z6mr16794751oea.90.1346845656276; Wed, 05 Sep 2012 04:47:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.11.168 with HTTP; Wed, 5 Sep 2012 04:47:16 -0700 (PDT) In-Reply-To: References: From: Harsh J Date: Wed, 5 Sep 2012 17:17:16 +0530 Message-ID: Subject: Re: directory delete in hadoop To: user@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnZ9KOSWOyzhP73WDTv490N2K+MsY1kKjgpCJf3eAdwhfROpFdYy7+dYU5sX3FQyjjAIBic X-Virus-Checked: Checked by ClamAV on apache.org 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