From: Mr. Magic on 7 Jun 2010 09:30 I have a service (written by another group that won't change it) that will be creating files but it takes a while to process those files. I have a service that needs to access the file once the file has been written. How can I tell when the file has been closed and they are done processing it? TIA - Jeff.
From: Patrice on 7 Jun 2010 10:16 Hello, This is usually done by just opening the file in exclusive mode. If it fails with an IOException, this is that another process already opened the file (in which case you'll wait a bit before trying again). You have also an API that allows to find out which process has a file opened (or rather AFAIK what files are opened by each and every process) but is is used mainly by system tools and likey overkill if you just want to know if the file is locked or not... -- Patrice
|
Pages: 1 Prev: hexedit assembly - snk, strong name, sing assembly question Next: MDI Parent - Timer |