Close
jGuru Forums
Posted By: vijay_n Posted On: Saturday, April 8, 2006 04:25 PM
Hi , I am running a 100 mb file which conatins text file .I am converting all text files into html files then into zip file. Iam ruunning two threads to create html and zip files. After creating html iam creating zip files simultaniously. But while generating zip file it is throwing up an error like : java.io.IOException: Bad file descriptor COde for zipping is : try{ String command = "wzzip -s" + password + " " + outFileName + " " + inFileName; brOpt = new BufferedReader( new InputStreamReader( System.in ) ); rTime = Runtime.getRuntime(); pr = rTime.exec( command ); brMess = new BufferedReader( new InputStreamReader( pr.getInputStream() ) ); brErr = new BufferedReader( new InputStreamReader( pr.getErrorStream() ) ); System.out.println("Before if*****************"); while (brMess.readLine() == null){ if(brErr!=null) throw new java.io.IOException("File Not Created"); sleep(1000); } String strMess = brMess.readLine(); String strErr = brErr.readLine(); if( strMess != null ) { strMess = brMess.readLine(); }else if( strErr != null ) { throw new java.io.IOException("File Not Created"); } }catch(Exception e){ e.printStackTrace(); }finally{ try { if (brOpt != null) brOpt.close(); if (brMess != null) brMess.close(); if (brErr != null) brErr.close(); if (pr != null) pr.destroy(); if(rTime!=null) rTime = null; System.out } catch (Exception ex) { ex.printStackTrace(); } } Please help me............. Regards Vijay
Re: java.io.IOException: Bad file descriptor
Posted By: Otis_Gospodnetic Posted On: Thursday, April 13, 2006 05:30 PM