Details
Description
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)
+
+
// build and run the 'dir' command
String[] cmdAttribs =
- (kb ? new String[]
{"df", "-k", path}
: new String[]
{"df", path});
{dfCmd, dfOpts, path}
+ (kb ? new String[]: new String[]
{dfCmd, path});
// read the output from the command until we come to the second line
long bytes = -1;
Attachments
Attachments
Issue Links
- relates to
-
IO-83 Bug with 'df' command on AIX 5.3
- Closed