"Xero" <jeff_at_chezjeff_dot_net> schrieb:
how do you check if a file (say, a txt one) is being used by another
process?
thanks.
If you want to check if the file is exclusively locked, open a 'FileStream'
with 'FileShare.None' and 'FileAccess.ReadWrite', and catch the exception
which occurs if the file cannot be opened that way. Note that this will
only work if the application currently dealing with the file actually locked
the file.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>