Index: Cab.java
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java,v
retrieving revision 1.4
diff -u -r1.4 Cab.java
--- Cab.java	2000/09/07 09:50:56	1.4
+++ Cab.java	2000/11/01 08:41:42
@@ -295,50 +295,66 @@
     }
 
     public void execute() throws BuildException {
-        // we must be on Windows to continue
-        if (!isWindows)
-        {
-            log("cannot run on non-Windows platforms: " + myos,
-                Project.MSG_VERBOSE);
-            return;
-        }
-        
+
         checkConfiguration();
 
         Vector files = getFileList();
-        
+    
         // quick exit if the target is up to date
         if (isUpToDate(files)) return;
 
         log("Building "+ archiveType +": "+ cabFile.getAbsolutePath());
 
-        try {
-            File listFile = createListFile(files);
-            ExecTask exec = createExec();
-            File outFile = null;
+        // we must be on Windows to continue
+        if (!isWindows) {
+            log("Using listcab/libcabinet", Project.MSG_VERBOSE);
+            
+            StringBuffer sb = new StringBuffer();
+            
+            Enumeration fileEnum = files.elements();
             
-            // die if cabarc fails
-            exec.setFailonerror(true);
-            exec.setDir(baseDir);
+            while (fileEnum.hasMoreElements()) {
+                sb.append(fileEnum.nextElement()).append("\n");
+            }
+            sb.append("\n").append(cabFile.getAbsolutePath()).append("\n");
             
-            if (!doVerbose)
-            {
-                outFile = createTempFile("ant", null);
-                exec.setOutput(outFile);
+            try {
+                Process p = Runtime.getRuntime().exec("listcab");
+                OutputStream out = p.getOutputStream();
+                out.write(sb.toString().getBytes());
+                out.flush();
+                out.close();
+            } catch (IOException ex) {
+                String msg = "Problem creating " + cabFile + " " + ex.getMessage();
+                throw new BuildException(msg);
             }
+        } else {
+            try {
+                File listFile = createListFile(files);
+                ExecTask exec = createExec();
+                File outFile = null;
                 
-            exec.setCommand(createCommand(listFile));
-            exec.execute();
-
-            if (outFile != null)
-            {
-                outFile.delete();
+                // die if cabarc fails
+                exec.setFailonerror(true);
+                exec.setDir(baseDir);
+                
+                if (!doVerbose) {
+                    outFile = createTempFile("ant", null);
+                    exec.setOutput(outFile);
+                }
+                    
+                exec.setCommand(createCommand(listFile));
+                exec.execute();
+    
+                if (outFile != null) {
+                    outFile.delete();
+                }
+                
+                listFile.delete();
+            } catch (IOException ioe) {
+                String msg = "Problem creating " + cabFile + " " + ioe.getMessage();
+                throw new BuildException(msg);
             }
-            
-            listFile.delete();
-        } catch (IOException ioe) {
-            String msg = "Problem creating " + cabFile + " " + ioe.getMessage();
-            throw new BuildException(msg);
         }
     }
 }
