wood burning stoves*
The moose likes Beginning Java and the fly likes File IO Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "File IO Question" Watch "File IO Question" New topic
Author

File IO Question

Shane Burgel
Ranch Hand

Joined: Sep 09, 2003
Posts: 47
I have a File object and I want to be able to know if the actual file on the disk that it references is currently being written to. Is there any way to do this?
Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

To see if the file is currently being written to, you could check the size a few times using the length() method to determine if the file is growing or shrinking. I believe this will work.

Hope it helps!

Barry
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: File IO Question