So I am struggling through Linux issue and was hoping I might get some help. Currently I am trying to create a directory, which will be used to right files to. I don't actually create this directory till the first file is created. The code to create this directory is:
File dir = new file(/var/log/newFile);
The first is it keeps telling me I don't have permission to write the file, is there a way to override this?
The Second when I create the file manually I cant write to it... this should be taken care of with
You don't have permission to create that directory? Then sure, there's a way to deal with that. But not through Java, of course. You just execute a suitable Unix command which grants you that permission, or you get somebody with enough permissions to run that command.
Joined: Feb 08, 2010
Okay I guess ill stuff it in the RPM spec file then, that seems to get run as root!
John Lark wrote:Okay I guess ill stuff it in the RPM spec file then, that seems to get run as root!
You can scratch the "seems to". RPMs installed as production OS components MUST be installed using root privileges - if for no other reason that the RPM database is not updatable by non-root users and until the database is updated, the package isn't officially "installed".
An IDE is no substitute for an Intelligent Developer.