java创建文件夹 java文件夹
程序员文章站
2022-06-23 20:39:54
...
try
{
if(!(new File("D:/java/newdata/").isDirectory()))
{
new File("D:/java/newdata/").mkdir();
new File("D:/java/newdata/2003-04-14/").mkdir();
}
else
{
new File("D:/java/newdata/2003-04-14/").mkdir();
}
}
catch(SecurityException e)
{
System.out.println("can not make directory");
}
File myFile = new File("D:/java/newdata/2003-04-14/myfile.txt ");
FileOutStream fos = new FileOutStream(myFile);
用fos.write("你要写入的内容");
上一篇: 数据库性能调优