JGhost Posted May 2, 2016 Posted May 2, 2016 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?
Token Posted May 2, 2016 Posted May 2, 2016 Read the last updates on the dev builds from .54 to .57 and .58. IO is no longer allowed outside the user.home\OSBot\Data directory. 1
The Hero of Time Posted May 2, 2016 Posted May 2, 2016 i think osbot doesn't allow you to write anything outside of the osbot folder
JGhost Posted May 2, 2016 Author Posted May 2, 2016 Thanks for the super quick reply guys. I changed my path from C:\Users\John\Desktop\Area to C:\Users\John\OSBot\Data\Area it's working fine. 1
Lemons Posted May 2, 2016 Posted May 2, 2016 File myFile = new File(System.getProperty("user.home") + "/OSBot/Data/JGhost/Area/Area661830290.txt"
JGhost Posted May 2, 2016 Author Posted May 2, 2016 (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 May 2, 2016 by JGhost