in reply to Check whether a file is open
This is one thorny problem. Take, for example, a file arriving via an ftp or scp delivery. The client program may open the file start writing, pause, write some more, operate slowly due to the bandwidth and eventually, maybe sometime finish the transfer. In the meantime your process, running quickly on the local box how no way of knowing whether it is safe to operate on the file.
Grrrrr there's no cross platform, consistent way to find out if a file is open. If you're in this position, you have to develop some sanity check method(s) to assure yourself the process writing to the file is finished.
If you're beginning to think I've been bitten by this, you're right. What we eventually did was:
I wish there was a better way. If there is one I'd love to hear about it. If there is a filesysystem that implements something like electricians locks I'd put it on all the systems I'm responsible for.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Check whether a file is open
by tirwhan (Abbot) on Jun 02, 2005 at 16:53 UTC | |
|
Re^2: Check whether a file is open
by ambrus (Abbot) on Jun 02, 2005 at 21:12 UTC |