Open TianYuanSX opened 6 years ago
Please attach that code sample as txt file so I can use it as test case.
Here is the text edition. It will lose the last '}' with OneNote 2016 64bit zh-cn
public static void copy(File[] files, File dst) { if (!dst.exists()) {// 不存在文件夹的话自动创建 dst.mkdirs(); } for (int i = 0; i < files.length; i++) { if (files[i].isFile()) { FileInputStream fin = null; FileOutputStream fout = null; try { fin = new FileInputStream(files[i]); fout = new FileOutputStream(new File(dst.getPath() + File.separator + files[i].getName()));// 创建要目的地的文件名称 byte[] buffers = new byte[512]; int numberRead = 0; while ((numberRead = fin.read(buffers)) != -1) { fout.write(buffers, 0, numberRead);// 进行复制操作 } fin.close(); fout.close(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO: handle exception e.printStackTrace(); }
} else if (files[i].isDirectory()) {
File newPath = new File(dst.getPath() + File.separator + files[i].getName());
// 如果是文件夹的话,进一步访问下一级目录,开始新一轮迭代
copy(files[i].listFiles(), newPath);
}
}
}
Not able to reproduce if I only paste this text. Please make sample OneNote page where you are having this issue and attach it here.
Thanks for your dedicated work and this tool helps me a lot when I use OneNote for learning coding. However, sometimes it doesn't work well, especially when I am coping a large piece of code including some {}, the example like this
The } at the end of the code will lose and this problem recurs several times.
Hope this will improve in the coming version.