I've been reading up on file permissions (including FilePermission,
Permission, and Permissions). From what I see, these are temporary and
forgotten when a program exits (if I'm wrong, tell me, please).
I'm installing a program on a computer and that includes configuration files
that change regularly. When I create the configuration files, I want them
to be readable and writable by any user running the program, otherwise my
program won't be able to function.
So how can I, from Java, find a way to set the permissions on a file I
create (from within Java) so all users can read and write that file
whenever they run the program?
My first thought was to have the program itself, whenever it was started,
set the permissions with a FilePermission object, but that doesn't make
sense -- if files are not readable or writable by a user, it wouldn't make
sense to allow that user to change the permissions.
Thanks for any info.
Hal
Permission, and Permissions). From what I see, these are temporary and
forgotten when a program exits (if I'm wrong, tell me, please).
I'm installing a program on a computer and that includes configuration files
that change regularly. When I create the configuration files, I want them
to be readable and writable by any user running the program, otherwise my
program won't be able to function.
So how can I, from Java, find a way to set the permissions on a file I
create (from within Java) so all users can read and write that file
whenever they run the program?
My first thought was to have the program itself, whenever it was started,
set the permissions with a FilePermission object, but that doesn't make
sense -- if files are not readable or writable by a user, it wouldn't make
sense to allow that user to change the permissions.
Thanks for any info.
Hal
Comment