Meaningless Drivel is fun!
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "File IO Question" Watch "File IO Question" New topic

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!

I agree. Here's the link:
subject: File IO Question
It's not a secret anymore!