Java: Create a new dir with 777 permissions on Mac

自作多情 提交于 2020-01-04 13:28:50

问题


I am trying to create a directory with 777 permissions on Mac.

I am using this but I cannot delete the directory with php:

File f = new File("/Applications/XAMPP/xamppfiles/htdocs/project/images/directoryName");
f.setWritable(true);
f.mkdir();

When I try to delete this directory I am getting this:

unlink(project/images/directoryName/subFile): Permission denied in 

I need to create folders and files on htdocs folder with my Java App and delete or edit them using php.


回答1:


try this:

Runtime.getRuntime().exec("chmod 777 /Applications/XAMPP/xamppfiles/htdocs/project/images/directoryName");


来源:https://stackoverflow.com/questions/21575919/java-create-a-new-dir-with-777-permissions-on-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!