Java:在Mac上使用777权限创建一个新目录 [英] Java: Create a new dir with 777 permissions on Mac

查看:321
本文介绍了Java:在Mac上使用777权限创建一个新目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Mac上创建一个具有777权限的目录.

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

我正在使用它,但是无法使用php删除目录:

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 

我需要使用Java应用在htdocs文件夹上创建文件夹和文件,然后使用php删除或编辑它们.

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

推荐答案

尝试一下:

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

这篇关于Java:在Mac上使用777权限创建一个新目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆