MyException - 我的异常网
当前位置:我的异常网» J2SE » java.io.IOException: Bad file descriptor

java.io.IOException: Bad file descriptor

www.MyException.Cn  网友分享于:2013-12-27  浏览:998次
请问:bad file descriptor是什么错误?
这是源代码:[code=Java]import java.io.*;
public class FileTest2{
public static void main(String[] args){
FileOutputStream fos = null ;
try{
fos = new FileOutputStream("F:\\java_ex\\abc.txt");
}catch(FileNotFoundException fnf){
fnf.printStackTrace();
}
for(int i='A';i<'Z';i++){
try{
fos.write(i);
fos.close();
}catch(IOException ioe){
ioe.printStackTrace();
}
}
}
}[/code]
这是错误提示:
F:\java_ex>javac FileTest2.java

F:\java_ex>java FileTest
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)
  at FileTest.main(FileTest.java:38)
java.io.IOException: Bad file descriptor
  at java.io.FileOutputStream.write(Native Method)

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有