try {
//step1.1生成文件确认路径
dir = new File(ConstantsUtil.quotes_path);
if (!dir.exists())
dir.mkdirs();
//step1.2确认生成文件
_fPath =new File(dataFilePath);
if(!_fPath.exists())
_fPath.createNewFile();
_fPath.setReadable(true, false);
_fPath.setWritable(true, false);
Runtime.getRuntime().exec(new String[]{ "chmod -R 777 " , dataFilePath});
//step1.3 写入数据
fos=new FileOutputStream(_fPath);
osw=new OutputStreamWriter(fos,"UTF-8");
osw.write("//staticDate="+ DateUtil.getToday() +" \n");
osw.write("[");
。。。
这是生成文件的代码片段,window下没问题 到了linux下
生成的文件
该写的都写了 怎么linux下的文件还是没有权限?
元芳怎么了
守候你守候我
蓝山帝景