Jump to content

can not create a text file


Recommended Posts

Posted
I'm getting this error when attempting to create a text file:

 

[ERROR][05/02 09:37:33 AM]: Uncaught exception!

java.security.AccessControlException: access denied ("java.io.FilePermission" "C:\Users\John\Desktop\Area\Area661830290.txt" "write")

 

My script was working fine yesterday. The only things that have changed was updating from...

jdk1.8.0_65 to jre1.8.0_91 

and

OSBot 2.4.53 to OSBot 2.4.58

 

now my script create a text file in a directory that it has many times before.

 

does anyone know how I can fix this?

Posted (edited)
File myFile = new File(System.getProperty("user.home")  + "/OSBot/Data/JGhost/Area/Area661830290.txt"

 

Even better!

 

In case I needed to share my script, it wouldn't adapt well the way I current have it; using absolute path. Using System.getProperty would definitely work a lot better. Thanks for sharing

Edited by JGhost

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...