File dir= new File(dirname);
        if ( !dir.exists()) {
            dir.mkdirs();
        }//创建文件夹        try
        {
            PrintWriter pw = new PrintWriter(new FileOutputStream(savelogdir));
            pw.write(totalStr);
            pw.close();
        }
        catch(IOException e){
            errcode = -1;
        }//向文件中写入数据,totalStr就是要写入文件的数据的字符串