RandomAccessFile ra = new RandomAccessFile("c:\f.txt", "rw") ;
long l = ra.length(); //文件长度
ra.seek(l);   //文件指针位置,移到文件末尾  可再写数据,不会覆盖以前的数据

解决方案 »

  1.   

    是说JAVA么?
    看看FileOutputStream的构造函数:
    public FileOutputStream(String name,
                            boolean append)
                     throws FileNotFoundException
    只要给出第二个参数为true就可以了。
    eg:
    FileOutputStream fos = new FileOutputStream("c:\\temp\\test.txt",true);
      

  2.   

    hexiaofeng(java爱好者)的方法与marshallmar(小马)的哪个更好一些!!望指点!!!