Java: Check if file is already open

Posted by hello_world_infinity on Stack Overflow See other posts from Stack Overflow or by hello_world_infinity
Published on 2009-09-07T18:53:36Z Indexed on 2010/05/16 11:00 UTC
Read the original article Hit count: 166

Filed under:
|

I need to write a custom batch File renamer. I've got the bulk of it done except I can't figure out how to check if a file is already open. I'm just using the java.io.File package and there is a canWrite() method but that doesn't seem to test if the file is in use by another program. Any ideas on how I can make this work?

© Stack Overflow or respective owner

Related posts about java

Related posts about file-io