How to tell if a file is being written to?
I am posting this on behalf of a friend of mine. I am going under the assumption that he can't have the sender create a lock file:
"Here's the situation:
-A large file is transferred to a Unix box via connect:direct.
-While the file is being transferred, a Java utility on the Unix box fires up and starts to copy the file before it has been completely transferred, thus the copied version isn't complete.
Any ideas on how to prevent the copy step from occuring before the transfer is finished? I'm currently checking to see if the file is writeable (if (files[i].canWrite()), thinking that the file won't be writeable until the transfer is complete. But that isn't working. Any ideas would be appreciated."
"Here's the situation:
-A large file is transferred to a Unix box via connect:direct.
-While the file is being transferred, a Java utility on the Unix box fires up and starts to copy the file before it has been completely transferred, thus the copied version isn't complete.
Any ideas on how to prevent the copy step from occuring before the transfer is finished? I'm currently checking to see if the file is writeable (if (files[i].canWrite()), thinking that the file won't be writeable until the transfer is complete. But that isn't working. Any ideas would be appreciated."
