• Post Reply Bookmark Topic Watch Topic
  • New Topic

while getting the file permission denied  RSS feed

 
sandhya sri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks in advance.

In my application

java.io.File file = new java.io.File("/home/aaa/Desktop","party.txt" );

this is giving
Caused by: java.io.FileNotFoundException: home/aaaa/Desktop/party.txt (No such file or directory).

even the file exists that particular folder.

What is the solution for this?
 
Paul Clapham
Sheriff
Posts: 22509
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have misidentified the problem. That constructor will never throw that exception. Have another look at the stack trace to see what actually threw it.
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like the thing you're using to open the file (FileInputStream, FileOutputStream, FileReader, FileWriter, RandomAccessFile, ...) is using a different path, without the leading /.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!