java - How do i programmatically change file permissions? -


in java, i'm dynamically creating set of files , i'd change file permissions on these files on linux/unix file system. i'd able execute java equivalent of chmod. possible java 5? if so, how?

i know in java 6 file object has setreadable()/setwritable() methods. know make system call this, i'd avoid if possible.

full control on file attributes available in java 7, part of "new" new io facility (nio.2). example, posix permissions can set setposixfilepermissions().

in earlier versions of java, using native code of own, or exec-ing command-line utilities common approaches.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -