Results 1 to 5 of 5
- 04-10-2011, 04:10 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 11
- Rep Power
- 0
Folder locking by other process/application...
Hi Friends,
I'm getting the "Access is Denied" exceptions while trying to create file with help of FileOutputStream in java.
Please note that,
- My application has write access to the folder,
- Target folder isn't read-only,
- There isn't a folder existing already at the target location with same name as the filename i create
Still i get this application. One thing i noted is machine restart helps me come out of this problem.
A standalone program written is able to write file at same application as well..
Please help me with your thoughts o how can i determine the process/application that is locking my target folder...Is there a way in java to determine this?
Regards,
Bharath M
- 04-10-2011, 04:43 AM #2
You can't determine which program is using the file/folder in Java.
This is not a problem with Java but with your computer. Some other program is already accessing the file when your program wants to. In Windows 7, the easiest way to determine this is to right click the file and delete it. It will says "Cannot delete, file is open in {PROGRAM NAME}."
- 04-10-2011, 07:17 AM #3
Member
- Join Date
- Apr 2011
- Posts
- 11
- Rep Power
- 0
I agree this isn't a problem with java...but i would rather need a way to know which process is holding a lock over the file/folder...
Would Process Explorer be handy for this?
- 04-10-2011, 07:53 AM #4
- 04-10-2011, 08:49 AM #5
Senior Member
- Join Date
- Nov 2010
- Location
- Delhi
- Posts
- 135
- Blog Entries
- 1
- Rep Power
- 0
Is your program behaving in this manner:
After restart of machine, run your program and see if it works?
If it works only for the first time and from second time onwards it starts giving the exception, then its your program which is causing the trouble.
Just try this and let us know the program behavior. If this is the case, may be I can help.
Similar Threads
-
Application Specific folder
By 123456 in forum Advanced JavaReplies: 4Last Post: 06-14-2010, 09:27 AM -
Process.waitFor() method hangs application.
By simmi in forum New To JavaReplies: 2Last Post: 02-10-2010, 03:35 AM -
How to send keystroke/text to some another application/process
By vinc in forum Advanced JavaReplies: 4Last Post: 11-26-2009, 09:40 AM -
preventing access/locking a folder?
By solris in forum New To JavaReplies: 1Last Post: 06-29-2009, 12:20 AM -
Need help - Create an application to loop through folder of images & insert to db
By kissiffer4 in forum SWT / JFaceReplies: 2Last Post: 11-21-2008, 05:59 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks