Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4357AD104 for ; Sun, 18 Nov 2012 20:19:00 +0000 (UTC) Received: (qmail 59932 invoked by uid 500); 18 Nov 2012 20:18:58 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 59869 invoked by uid 500); 18 Nov 2012 20:18:58 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 59760 invoked by uid 99); 18 Nov 2012 20:18:58 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Nov 2012 20:18:58 +0000 Date: Sun, 18 Nov 2012 20:18:58 +0000 (UTC) From: "Daniel Bengtsson (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <1276931637.651.1353269938735.JavaMail.jiratomcat@arcas> In-Reply-To: <1567468094.640.1353268858985.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (HADOOP-9060) isSymlink returns false for link to non-existing file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-9060?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Bengtsson updated HADOOP-9060: ------------------------------------- Description: This problem showed when trying to use FileUtils.sizeOfDirectory() of a directory that contained a symlink to a file that did not exist. I got the exception: java.lang.IllegalArgumentException: /tmp/test/link does not exist at org.apache.commons.io.FileUtils.sizeOf(FileUtils.java:2413) at org.apache.commons.io.FileUtils.sizeOfDirectory(FileUtils.java:2479) And /tmp/test/link is here linking to a file that do not exist. The trace comes from a unit test that looks like: assertTrue(FileUtils.sizeOfDirectory(new File("/tmp/test/")) > 0); I would expect that either isSymlink() reported true even though the link is to a file that do not exist or sizeOfDirectory() should not bail out when encountering non-existing files. was: This problem showed when trying to use FileUtils.sizeOfDirectory() of a directory that contained a symlink to a file that did not exist. I got the exception: java.lang.IllegalArgumentException: /tmp/test/link does not exist at org.apache.commons.io.FileUtils.sizeOf(FileUtils.java:2413) at org.apache.commons.io.FileUtils.sizeOfDirectory(FileUtils.java:2479) And /tmp/test/link is here linking to a file that do not exist. The trace comes from a unit test that looks like: assertTrue(FileUtils.sizeOfDirectory(new File("/tmp/test/")) > 0); To me I would expect that either isSymlink() reported true even though the link is to a file that do not exist or sizeOfDirectory() should not bail out when encountering non-existing files. > isSymlink returns false for link to non-existing file > ----------------------------------------------------- > > Key: HADOOP-9060 > URL: https://issues.apache.org/jira/browse/HADOOP-9060 > Project: Hadoop Common > Issue Type: Bug > Environment: Kubuntu 12.10 commons-io 2.4 > Reporter: Daniel Bengtsson > > This problem showed when trying to use FileUtils.sizeOfDirectory() of a directory that contained a symlink to a file that did not exist. I got the exception: > java.lang.IllegalArgumentException: /tmp/test/link does not exist > at org.apache.commons.io.FileUtils.sizeOf(FileUtils.java:2413) > at org.apache.commons.io.FileUtils.sizeOfDirectory(FileUtils.java:2479) > And /tmp/test/link is here linking to a file that do not exist. > The trace comes from a unit test that looks like: > assertTrue(FileUtils.sizeOfDirectory(new File("/tmp/test/")) > 0); > I would expect that either isSymlink() reported true even though the link is to a file that do not exist or sizeOfDirectory() should not bail out when encountering non-existing files. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira