Forums Register Login

Access Denied Error with RandomAccessFile

+Pie Number of slices to send: Send
I am accessing the file using RandomAccessFile .
I get following error
Exception in thread "main" java.lang.RuntimeException: The given file does not exist.
at scjd.DBFileReader.main(DBFileReader.java:213)
Caused by: java.io.FileNotFoundException: C:\db-1x3.db (Access is denied)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
at scjd.DBFileReader.main(DBFileReader.java:100)
Java Result: 1


The file exists at the location and if I only read is successful operation with parameter "r"
If I pass "rw" then I get the above error.

Can anyone help me with this error .
+Pie Number of slices to send: Send
Oops ! I figured it out .
I put the file in C:\ drive . It was giving me only read access .
I created C:\test folder and put the db file there .
And now I don't get the error 'Access Denied' .

Isn't this weired ?
+Pie Number of slices to send: Send
It must have been read only access. Once you placed in the folder the folder must not have read only access!
Grow your own food... or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 5294 times.
Similar Threads
java I/O
Problem in using TOMCAT
AccessControlException when accessing Bean in JBOSS
Database file reader
NX: db-2x1?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:02:37.