0

I'm running a Jython 2.1 script on Windows 7 that calls an external program via os.system. The script is run inside Jython embedded into a Java application.

This external program writes a file, but if it tries to write the file to a folder the current user does not have permissions for, the file never appears there. The external program does not notice that and returns as if the operation was successful.

How can I check from Jython if the current user has permissions for a certain folder? Could I even enable a UAC prompt so that the user can choose to write to a protected folder?

Mad Scientist
  • 18,090
  • 12
  • 83
  • 109

1 Answers1

1
File f = new File();
f.canRead();  // checks the permissions to read
f.canWrite(); // writpermission

And there is no way to check the UAC with Java < 7.

With Java 7 you will be able to check the UAC (afaik).

I have a similar Problem: Check if another user have the permission to write a File

Community
  • 1
  • 1
Christian Kuetbach
  • 15,850
  • 5
  • 43
  • 79