Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 82167 invoked from network); 25 Jan 2007 23:44:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jan 2007 23:44:13 -0000 Received: (qmail 29926 invoked by uid 500); 25 Jan 2007 23:44:16 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 29861 invoked by uid 500); 25 Jan 2007 23:44:16 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 29845 invoked by uid 99); 25 Jan 2007 23:44:16 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jan 2007 15:44:16 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jan 2007 15:44:09 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7765E7142B6 for ; Thu, 25 Jan 2007 15:43:49 -0800 (PST) Message-ID: <23360286.1169768629486.JavaMail.jira@brutus> Date: Thu, 25 Jan 2007 15:43:49 -0800 (PST) From: "Stephen Colebourne (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Commented: (IO-109) FileSystemUtils freeSpaceUnix does not work for HP-UX 11 In-Reply-To: <14083789.1168550487933.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IO-109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467701 ] Stephen Colebourne commented on IO-109: --------------------------------------- The new IO v1.3 release is going to use -kP. Let us know if this works. > FileSystemUtils freeSpaceUnix does not work for HP-UX 11 > -------------------------------------------------------- > > Key: IO-109 > URL: https://issues.apache.org/jira/browse/IO-109 > Project: Commons IO > Issue Type: Bug > Components: Utilities > Affects Versions: 1.2 > Environment: uname -a > HP-UX mbfwdv B.11.11 U 9000/800 3509210950 unlimited-user license > Reporter: Christopher Olsen > Attachments: FileSystemUtils-HP-UX.fix > > > The freeSpaceUnix method does not work under HP-UX. The df command under HP-UX is the old System V varient and the fields are not in the correct order. This diff modifies the code to use the 'bdf' command when HP-UX is detected: > --- FileSystemUtils.java 2006-03-19 12:42:48.000000000 -0800 > +++ FileSystemUtils-HP-UX-Fix.java 2007-01-11 13:05:34.844269000 -0800 > @@ -51,13 +51,15 @@ > private static final int WINDOWS = 1; > /** Operating system state flag for Unix. */ > private static final int UNIX = 2; > + /** Unix variant name */ > + private static String osName = null; > /** The operating system flag. */ > private static final int OS; > static { > int os = OTHER; > try { > - String osName = System.getProperty("os.name"); > + osName = System.getProperty("os.name"); > if (osName == null) { > throw new IOException("os.name not found"); > } > @@ -287,9 +289,18 @@ > } > path = FilenameUtils.normalize(path); > + // HP-UX sucks we need to use bdf instead > + String dfCmd = "df"; > + String dfOpts = "-k"; > + if (osName.indexOf("hp-ux") != -1) > + { > + dfCmd = "bdf"; > + dfOpts = ""; > + } > + > // build and run the 'dir' command > String[] cmdAttribs = > - (kb ? new String[] {"df", "-k", path} : new String[] {"df", path}); > + (kb ? new String[] {dfCmd, dfOpts, path} : new String[] {dfCmd, path}); > // read the output from the command until we come to the second line > long bytes = -1; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org