How to change image permission mode to 777 using Java code?

前端 未结 5 1557
野趣味
野趣味 2021-01-12 08:13

I want to give permissions mode value \"777\" to image file using Java code. How can I give that using Java? Because I can\'t delete the image with default permission mode \

5条回答
  •  走了就别回头了
    2021-01-12 09:03

    You can use the 'exec' method to run an external command to do the chmod.

    Runtime.getRuntime().exec( "chmod 777 myfile" );
    

提交回复
热议问题