aspose file tools*
The moose likes I/O and Streams and the fly likes FileNotFoundException - Access is denied Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "FileNotFoundException - Access is denied" Watch "FileNotFoundException - Access is denied" New topic
Author

FileNotFoundException - Access is denied

kamilla miesak
Ranch Hand

Joined: Mar 06, 2001
Posts: 30
Hello,
I keep getting FileNotFoundException - Access is denied - when i'm trying to create and print to a file located in user's current working directory.
The same code works fine if I explicitly specify already existing folder i.e. c:\temp\test.txt (the new file gets created and contents are added to it). What might me causing the problem?
Thanks in advance for all the ideas!
Kamilla
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
I'm not sure what's going on. How exactly are you attempting to create the new file? I suggest something like the following:

The getAbsolutePath() is useful because often people turn out to not be in the directory they think they are (depending on how they invoked the java command).
[ July 15, 2002: Message edited by: Jim Yingst ]

"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FileNotFoundException - Access is denied